本文整理汇总了C#中SYSModel.SQLObj类的典型用法代码示例。如果您正苦于以下问题:C# SQLObj类的具体用法?C# SQLObj怎么用?C# SQLObj使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SQLObj类属于SYSModel命名空间,在下文中一共展示了SQLObj类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BindTree
/// <summary>
/// 公司组织树
/// </summary>
private void BindTree()
{
string strSql = "select '0' as ftype, c.com_id as id,c.parent_id,'' as ocom_id,c.com_code as code,c.com_name as name from tb_company c where c.enable_flag ='1' union all "
+ "select '1' as ftype, o.org_id as id,o.parent_id,o.com_id as ocom_id,o.org_code as code,o.org_name as name from tb_company c,tb_organization o where "
+ " c.enable_flag ='1' and o.enable_flag='1' and c.com_id=o.com_id ";
SYSModel.SQLObj sqlobj = new SYSModel.SQLObj();
sqlobj.cmdType = CommandType.Text;
sqlobj.Param = new Dictionary<string, SYSModel.ParamObj>();
sqlobj.sqlString = strSql;
DataSet ds = DBHelper.GetDataSet("查询公司组织树", sqlobj);
tvCompany.Nodes.Clear();
//节点加上去
if (ds.Tables[0].Rows.Count > 0)
{
//clsGetTree cls = new clsGetTree();
CommonCtrl.InitTree(this.tvCompany.Nodes, "-1", ds.Tables[0].DefaultView);
if (tvCompany.Nodes.Count > 0)
{
tvCompany.Nodes[0].Expand();
}
}
}
示例2: UCVehicleView_StatusEvent
void UCVehicleView_StatusEvent(object sender, EventArgs e)
{
List<SQLObj> listSql = new List<SQLObj>();
SQLObj obj = new SQLObj();
obj.cmdType = CommandType.Text;
Dictionary<string, ParamObj> dicParam = new Dictionary<string, ParamObj>();
string strMsg = string.Empty;
if (strStatus == Convert.ToInt32(DataSources.EnumStatus.Start).ToString())
{
strMsg = "停用";
dicParam.Add("status", new ParamObj("status", DataSources.EnumStatus.Stop, SysDbType.VarChar, 40));//状态
}
else if (strStatus == Convert.ToInt32(DataSources.EnumStatus.Stop).ToString())
{
strMsg = "启用";
dicParam.Add("status", new ParamObj("status", DataSources.EnumStatus.Start, SysDbType.VarChar, 40));//状态
}
if (MessageBoxEx.Show("确认要" + strMsg + "吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
{
return;
}
dicParam.Add("v_id", new ParamObj("v_id", strVId, SysDbType.VarChar, 40));//车辆档案Id
dicParam.Add("update_by", new ParamObj("update_by", HXCPcClient.GlobalStaticObj.UserID, SysDbType.VarChar, 40));//修改人Id
dicParam.Add("update_time", new ParamObj("update_time", Common.LocalDateTimeToUtcLong(HXCPcClient.GlobalStaticObj.CurrentDateTime).ToString(), SysDbType.BigInt));//修改时间
obj.sqlString = "update tb_vehicle set [email protected],[email protected]_by,[email protected]_time where [email protected]_id";
obj.Param = dicParam;
listSql.Add(obj);
if (DBHelper.BatchExeSQLMultiByTrans("更新单据状态为启停用", listSql))
{
MessageBoxEx.Show("" + strMsg + "成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
uc.BindPageData();
deleteMenuByTag(this.Tag.ToString(), this.uc.Name);
}
}
示例3: UCMemberParaView_Load
private void UCMemberParaView_Load(object sender, EventArgs e)
{
CommonFuncCall.BindComBoxDataSource(cbomember_grade_id, "sys_member_grade", "请选择");
if (wStatus == WindowStatus.View)
{
string strSql = "select c.*,(select USER_NAME from sys_user where user_id =c.create_by )as create_Username , "
+ "(select USER_NAME from sys_user where user_id =c.update_by ) as update_username from tb_CustomerSer_member_setInfo c where c.setInfo_id='" + id + "'";
SQLObj sqlobj = new SQLObj();
sqlobj.cmdType = CommandType.Text;
sqlobj.Param = new Dictionary<string, ParamObj>();
sqlobj.sqlString = strSql;
DataSet ds = DBHelper.GetDataSet("查询会员参数设置信息", sqlobj);
if (ds == null || ds.Tables[0].Rows.Count <= 0)
{
MessageBoxEx.Show("查询会员参数设置信息失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
DataTable dt = ds.Tables[0];
cbomember_grade_id.SelectedValue = dt.Rows[0]["member_grade_id"].ToString();
lblservice_project_discount.Text = dt.Rows[0]["service_project_discount"].ToString();
lblparts_discount.Text = dt.Rows[0]["parts_discount"].ToString();
lblSubscription_Ratio.Text = dt.Rows[0]["Subscription_Ratio"].ToString();
lblcreate_by.Text = dt.Rows[0]["create_Username"].ToString();
lblcreate_time.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(dt.Rows[0]["create_time"].ToString())).ToString();
lblupdate_by.Text = dt.Rows[0]["update_username"].ToString();
lblupdate_time.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(dt.Rows[0]["update_time"].ToString())).ToString();
ThreadPool.QueueUserWorkItem(new WaitCallback(this._LoadData));
}
DataGridViewStyle.DataGridViewBgColor(dgvprojrct);
DataGridViewStyle.DataGridViewBgColor(dgvparts);
SetSysManageViewBtn();
}
示例4: UCOrganizationView_Load
private void UCOrganizationView_Load(object sender, EventArgs e)
{
//base.RoleButtonStstus(uc.Name);//角色按钮权限-是否隐藏
//base.SetBtnStatus(wStatus);
DataSources.BindComBoxDataEnum(cbostate, typeof(DataSources.EnumStatus), true);//绑定状态 启用 停用
BindTree();
// string strSql = "SELECT o.*,(select USER_NAME from sys_user where user_id =o.create_by )as create_Username , "
//+ "(select USER_NAME from sys_user where user_id =o.update_by ) as update_username FROM tb_organization o where org_id='" + id + "'";
//SELECT o.*,(select USER_NAME from sys_user where user_id =o.create_by )as create_Username ,
//(select USER_NAME from sys_user where user_id =o.update_by ) as update_username ,
//po.org_code as parentcode,po.org_name as parentname ,c.com_name ,c.com_code FROM tb_organization o
//left join tb_organization po on o.parent_id=po.org_id
//left join tb_company c on o.com_id=c.com_id
//where o.org_id='8b4471da-b9bd-4d59-b3f1-af1841dc3ab5'
string strSql = "SELECT o.*,(select USER_NAME from sys_user where user_id =o.create_by )as create_Username,";
strSql += "(select USER_NAME from sys_user where user_id =o.update_by ) as update_username ,";
strSql += "po.org_code as parentcode,po.org_name as parentname ,c.com_name ,c.com_code FROM tb_organization o ";
strSql += "left join tb_organization po on o.parent_id=po.org_id ";
strSql += "left join tb_company c on o.com_id=c.com_id ";
strSql += "where o.org_id='" + id + "'";
SQLObj sqlobj = new SQLObj();
sqlobj.cmdType = CommandType.Text;
sqlobj.Param = new Dictionary<string, ParamObj>();
sqlobj.sqlString = strSql;
DataSet ds = DBHelper.GetDataSet("查询组织", sqlobj);
//DBHelper.GetTable("查询组织", "tb_organization", "*", "org_id='" + id + "'", "", "");
if (ds == null || ds.Tables[0].Rows.Count <= 0)
{
MessageBoxEx.Show("查询组织失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
DataTable dt = ds.Tables[0];
CommonCtrl.SelectTreeView(tvCompany, dt.Rows[0]["parent_id"].ToString());
if (dt.Rows[0]["parentname"] != null && dt.Rows[0]["parentname"].ToString() != string.Empty)
{ lblporg_name.Text = dt.Rows[0]["parentname"].ToString(); }
else
{ lblporg_name.Text = CommonCtrl.IsNullToString(dt.Rows[0]["com_name"]); }
if (dt.Rows[0]["parentcode"] != null && dt.Rows[0]["parentcode"].ToString() != string.Empty)
{ lblporg_code.Text = dt.Rows[0]["parentcode"].ToString(); }
else
{ lblporg_code.Text = CommonCtrl.IsNullToString(dt.Rows[0]["com_code"]); }
lblorg_code.Text = dt.Rows[0]["org_code"].ToString();
lblorg_name.Text = dt.Rows[0]["org_name"].ToString();
lblorg_short_name.Text = dt.Rows[0]["org_short_name"].ToString();
lblremark.Text = dt.Rows[0]["remark"].ToString();
lblcontact_name.Text = dt.Rows[0]["contact_name"].ToString();
lblcontact_telephone.Text = dt.Rows[0]["contact_telephone"].ToString();
lblcreate_Username.Text = dt.Rows[0]["create_Username"].ToString();
lblcreate_time.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(dt.Rows[0]["create_time"].ToString())).ToString();
lblupdate_username.Text = dt.Rows[0]["update_username"].ToString();
lblupdate_time.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(dt.Rows[0]["update_time"].ToString())).ToString();
cbostate.SelectedValue = dt.Rows[0]["status"].ToString();
SetSysManageViewBtn();
}
示例5: UCRepairRescueView_InvalidOrActivationEvent
void UCRepairRescueView_InvalidOrActivationEvent(object sender, EventArgs e)
{
string strmsg = string.Empty;
List<SQLObj> listSql = new List<SQLObj>();
SQLObj obj = new SQLObj();
obj.cmdType = CommandType.Text;
Dictionary<string, ParamObj> dicParam = new Dictionary<string, ParamObj>();
dicParam.Add("rescue_id", new ParamObj("rescue_id", strRescueId, SysDbType.VarChar, 40));//单据ID
dicParam.Add("update_by", new ParamObj("update_by", HXCPcClient.GlobalStaticObj.UserID, SysDbType.VarChar, 40));//修改人Id
dicParam.Add("update_name", new ParamObj("update_name", HXCPcClient.GlobalStaticObj.UserName, SysDbType.VarChar, 40));//修改人姓名
dicParam.Add("update_time", new ParamObj("update_time", Common.LocalDateTimeToUtcLong(HXCPcClient.GlobalStaticObj.CurrentDateTime).ToString(), SysDbType.BigInt));//修改时间
if (strStatus != Convert.ToInt32(DataSources.EnumAuditStatus.Invalid).ToString())
{
strmsg = "作废";
dicParam.Add("document_status", new ParamObj("document_status", DataSources.EnumAuditStatus.Invalid, SysDbType.VarChar, 40));//单据状态
}
else
{
strmsg = "激活";
string OnStatus = "";
DataTable dvt = DBHelper.GetTable("获得前一个状态", "tb_maintain_rescue_info_BackUp", "document_status", "rescue_id='" + strRescueId + "'", "", "order by update_time desc");
if (dvt.Rows.Count > 0)
{
DataRow dr = dvt.Rows[0];
OnStatus = CommonCtrl.IsNullToString(dr["document_status"]);
if (OnStatus == Convert.ToInt32(DataSources.EnumAuditStatus.Invalid).ToString())
{
DataRow dr1 = dvt.Rows[1];
OnStatus = CommonCtrl.IsNullToString(dr1["document_status"]);
}
}
OnStatus = !string.IsNullOrEmpty(OnStatus) ? OnStatus : Convert.ToInt32(DataSources.EnumAuditStatus.DRAFT).ToString();
dicParam.Add("document_status", new ParamObj("document_status", OnStatus, SysDbType.VarChar, 40));//单据状态
}
obj.sqlString = "update tb_maintain_rescue_info set [email protected]_status,[email protected]_by,[email protected]_name,[email protected]_time where [email protected]_id";
obj.Param = dicParam;
listSql.Add(obj);
if (MessageBoxEx.Show("确认要" + strmsg + "吗?", "提示", MessageBoxButtons.OKCancel) != DialogResult.OK)
{
return;
}
if (DBHelper.BatchExeSQLMultiByTrans("更新单据状态为" + strmsg + "", listSql))
{
MessageBoxEx.Show("" + strmsg + "成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
uc.BindPageData();
deleteMenuByTag(this.Tag.ToString(), "UCRepairRescueView");
}
else
{
MessageBoxEx.Show("" + strmsg + "失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
示例6: UCRoleView_Load
private void UCRoleView_Load(object sender, EventArgs e)
{
// base.RoleButtonStstus(uc.Name);//角色按钮权限-是否隐藏
//base.SetBtnStatus(wStatus);
DataSources.BindComBoxDataEnum(cbostate, typeof(DataSources.EnumStatus), true);//绑定状态 启用 停用
DataSources.BindComBoxDataEnum(cbodata_sources, typeof(DataSources.EnumDataSources), true);//数据来源 自建 宇通
DataTable dt = DBHelper.GetTable("查询角色", "v_role", "*", "role_id='" + id + "'", "", "");
if (dt.Rows.Count <= 0)
{
MessageBoxEx.Show("查询角色失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
lblRole_code.Text = dt.Rows[0]["role_code"].ToString();
lblRole_name.Text = dt.Rows[0]["Role_name"].ToString();
lblremark.Text = dt.Rows[0]["remark"].ToString();
lblcreate_by.Text = dt.Rows[0]["create_Username"].ToString();
lblcreate_time.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(dt.Rows[0]["create_time"].ToString())).ToString();
lblupdate_by.Text = dt.Rows[0]["update_username"].ToString();
lblupdate_time.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(dt.Rows[0]["update_time"].ToString())).ToString();
cbostate.SelectedValue = dt.Rows[0]["state"].ToString();
cbodata_sources.SelectedValue = dt.Rows[0]["data_sources"].ToString();
string strSql = "select u.user_id,u.user_code,u.user_name,u.user_phone,u.com_name,u.org_id,u.remark, u.org_name from v_User u ,tr_user_role ur,sys_role r "
+ " where u.user_id=ur.user_id and r.role_id=ur.role_id and r.enable_flag='1' and r.role_id='" + id + "' ";
SYSModel.SQLObj sqlobj = new SYSModel.SQLObj();
sqlobj.cmdType = CommandType.Text;
sqlobj.Param = new Dictionary<string, SYSModel.ParamObj>();
sqlobj.sqlString = strSql;
DataSet ds = DBHelper.GetDataSet("查询用户角色关系", sqlobj);
//dgvUser.DataSource = ds.Tables[0].DefaultView;
if (ds != null && ds.Tables[0].Rows.Count > 0)
{
foreach (DataRow dr in ds.Tables[0].Rows)
{
DataGridViewRow gvr = dgvUser.Rows[dgvUser.Rows.Add()];
gvr.Cells["user_id"].Value = dr["user_id"];
gvr.Cells["user_code"].Value = dr["user_code"];
gvr.Cells["user_name"].Value = dr["user_name"];
gvr.Cells["com_name"].Value = dr["com_name"];
gvr.Cells["org_name"].Value = dr["org_name"];
gvr.Cells["user_phone"].Value = dr["user_phone"];
gvr.Cells["remark"].Value = dr["remark"];
}
}
bindTree();
GetRoleFun("CL_ROOT");
DataGridViewStyle.DataGridViewBgColor(dgvFunction);
DataGridViewStyle.DataGridViewBgColor(dgvUser);
SetSysBtnView();
}
示例7: UserLogin
public static DataSet UserLogin(LoginInput loginO, string currAccDbName, string IPStr)
{
Dictionary<string, ParamObj> dic = new Dictionary<string, ParamObj>();
ParamObj paraO1 = new ParamObj();
paraO1.name = "land_name";
paraO1.size = 40;
paraO1.type = SysDbType.VarChar;
paraO1.value = loginO.username;
ParamObj paraO2 = new ParamObj();
paraO2.name = "password";
paraO2.size = 40;
paraO2.type = SysDbType.VarChar;
paraO2.value = loginO.pwd;
ParamObj paraO3 = new ParamObj();
paraO3.name = "login_time";
paraO3.type = SysDbType.BigInt;
paraO3.value = System.DateTime.Now.ToUniversalTime().Ticks;
ParamObj paraO4 = new ParamObj();
paraO4.name = "computer_ip";
paraO4.size = 40;
paraO4.type = SysDbType.VarChar;
paraO4.value = IPStr;
ParamObj paraO5 = new ParamObj();
paraO5.name = "computer_name";
paraO5.size = 40;
paraO5.type = SysDbType.NVarChar;
paraO5.value = loginO.ComputerName;
ParamObj paraO6 = new ParamObj();
paraO6.name = "computer_mac";
paraO6.size = 40;
paraO6.type = SysDbType.VarChar;
paraO6.value = loginO.MAC;
ParamObj paraO7 = new ParamObj();
paraO7.name = "login_Id";
paraO7.size = 40;
paraO7.type = SysDbType.VarChar;
paraO7.value = loginO.Login_Id;
dic.Add("land_name", paraO1);
dic.Add("password", paraO2);
dic.Add("login_time", paraO3);
dic.Add("computer_ip", paraO4);
dic.Add("computer_name", paraO5);
dic.Add("computer_mac", paraO6);
dic.Add("login_Id", paraO7);
SQLObj sqlObj = new SQLObj();
sqlObj.cmdType = System.Data.CommandType.StoredProcedure;
sqlObj.sqlString = "ServerUserLogin";
sqlObj.Param = dic;
DataSet ds = DBHelper.GetDataSet("服务器端用户登录", currAccDbName, sqlObj);
return ds;
}
示例8: Init
private void Init()
{
SetFuncationButtonVisible();
SetSettlementInfo();
SetServiceInfo();
SetSettlementOldInfo();
SetSettlementOtherInfo();
SetSettlementInventoryInfo();
#region 确认
btnConfirm.Click += delegate
{
var info = DBHelper.GetTable("查询结算单信息", "tb_maintain_three_guaranty_settlement", "*",
"st_id = '" + SettlementId + "'", "", "");
if (info != null && info.DefaultView.Count != 0)
{
foreach (DataRowView dr in info.DefaultView)
{
if (dr["info_status"].ToString() == DbDic2Enum.SYS_STATION_SETTLEMENT_STATUS_CONFIRM) continue;
var stId = dr["st_id"].ToString();
var sqlObjList = new List<SQLObj>();
var sqlObj = new SQLObj
{
cmdType = CommandType.Text,
sqlString =
"update tb_maintain_three_guaranty_settlement set [email protected]_status where [email protected]_id",
Param = new Dictionary<string, ParamObj>
{
{
"info_status",
new ParamObj
{
name = "info_status",
value = DbDic2Enum.SYS_STATION_SETTLEMENT_STATUS_CONFIRM
}
},
{"st_id", new ParamObj {name = "st_id", value = stId}}
}
};
UIAssistants.SetParamObjInfoByDB("tb_maintain_three_guaranty_settlement", sqlObj.Param);
sqlObjList.Add(sqlObj);
DBHelper.BatchExeSQLMultiByTrans("结算单信息确认", sqlObjList);
}
}
};
#endregion
}
示例9: GetIsUsePreOrder
public static DataView GetIsUsePreOrder(String preOrdeName, String preOrderColumnName, String postOrderName, String where)
{
if (String.IsNullOrEmpty(where)) where = "1=1";
var sqlStr = String.Format("select cc.* from (select bb.pre_order_id as tempcolum, bb.status, bb.post_order_name, aa.* from {0} aa left join tr_order_relation bb on aa.{1}=bb.pre_order_id) as cc where cc.tempcolum is null and (cc.post_order_name != '{2}' or cc.post_order_name is null) and {3}", preOrdeName, preOrderColumnName, postOrderName, where);
var sqlObj = new SQLObj
{
cmdType = CommandType.Text,
sqlString = sqlStr,
Param = new Dictionary<string, ParamObj>()
};
var dt = DBHelper.GetDataSet(String.Format("获取未被{0}占用的{1}单据", postOrderName, preOrdeName), sqlObj);
if (dt == null || dt.Tables.Count < 1 || dt.Tables[0].DefaultView == null) return null;
return dt.Tables[0].DefaultView;
}
示例10: GetIsUsePreOrder
public static DataView GetIsUsePreOrder(String preOrdeName, String preOrderColumnName, String postOrderName, String where)
{
if (String.IsNullOrEmpty(where)) where = "1=1";
var sqlStr = String.Format("select distinct bb.pre_order_id, bb.status, bb.post_order_name, aa.*,case when len(bb.post_item_order_name)>1 then '1' else bb.post_item_order_name end post_item_order_name from {0} aa left join tr_order_relation bb on aa.{1}=bb.pre_order_id where ((bb.pre_order_id is null and (bb.post_order_name != '{2}' or bb.post_order_name is null)) or (bb.post_order_name = '{2}' and bb.post_item_order_name is not null)) and {3}", preOrdeName, preOrderColumnName, postOrderName, where);
var sqlObj = new SQLObj
{
cmdType = CommandType.Text,
sqlString = sqlStr,
Param = new Dictionary<string, ParamObj>()
};
var dt = DBHelper.GetDataSet(String.Format("获取未被{0}占用的{1}单据", postOrderName, preOrdeName), sqlObj);
if (dt == null || dt.Tables.Count < 1 || dt.Tables[0].DefaultView == null) return null;
return dt.Tables[0].DefaultView;
}
示例11: _LoadData
private void _LoadData(object obj)
{
SQLObj sqlobj = new SQLObj();
sqlobj.cmdType = CommandType.Text;
sqlobj.Param = new Dictionary<string, ParamObj>();
sqlobj.sqlString = "SELECT p.*,w.project_name,w.project_num,w.quota_price,'' as discount_price FROM tb_CustomerSer_member_setInfo_projrct p left join tb_workhours w on w.whours_id=p.service_project_id "
+ " where p.enable_flag='1' and p.setInfo_id='" + id + "'";
sqlobj.sqlString += "; SELECT p2.*,w2.ser_parts_code,w2.parts_name,w3.ref_out_price,'' as discount_price FROM tb_CustomerSer_member_setInfo_parts p2 left join tb_parts w2 on w2.parts_id = p2.parts_id left join tb_parts_price w3 on w3.parts_id=p2.parts_id "
+ " where p2.enable_flag='1' and p2.setInfo_id='" + id + "'";
DataSet ds = DBHelper.GetDataSet("", sqlobj);
this.Invoke(this.uiHandler, ds);
}
示例12: BindStock
void BindStock(string parts_id)
{
StringBuilder sbWhere = new StringBuilder();
sbWhere.AppendFormat("stock_part_id='{0}'", parts_id);
string stockSql = string.Format(@"select parts_name,wh_name,
sum(case when statistic_Type=0 then statistic_count else 0 end) paper_count,
sum(case when statistic_Type=1 then statistic_count else 0 end) actual_count
from tb_parts_stock_p where stock_part_id='{0}'
group by parts_name,wh_name", parts_id);
SQLObj partsStock = new SQLObj();
partsStock.cmdType = CommandType.Text;
partsStock.Param = new Dictionary<string, ParamObj>();
partsStock.sqlString = stockSql;
DataTable dt = DBHelper.GetDataSet("查询配件库存", partsStock).Tables[0];
dgvDetail.DataSource = dt;
}
示例13: BindDgvProjrct
/// <summary>
/// 查询绑定会员参数设置特殊维修项目折扣
/// </summary>
private void BindDgvProjrct()
{
SQLObj sqlobj = new SQLObj();
sqlobj.cmdType = CommandType.Text;
sqlobj.Param = new Dictionary<string, ParamObj>();
sqlobj.sqlString = "SELECT p.*,w.project_name,w.project_num,w.quota_price,'' as discount_price FROM tb_CustomerSer_member_setInfo_projrct p left join tb_workhours w on w.whours_id=p.service_project_id "
+ " where p.enable_flag='1' and p.setInfo_id='" + id + "'";
DataSet dsProjrct = DBHelper.GetDataSet("查询会员参数设置特殊维修项目折扣", sqlobj);
if (dsProjrct != null && dsProjrct.Tables[0].Rows.Count > 0)
{
foreach (DataRow dr in dsProjrct.Tables[0].Rows)
{
DataGridViewRow row = dgvprojrct.Rows[dgvprojrct.Rows.Add()];
row.Cells["project_num"].Value = dr["project_num"].ToString();
row.Cells["project_name"].Value = dr["project_name"].ToString();
row.Cells["quota_price"].Value = dr["quota_price"].ToString();
row.Cells["project_service_project_discount"].Value = dr["service_project_discount"].ToString();
row.Cells["project_remark"].Value = dr["remark"].ToString();
row.Cells["service_project_id"].Value = dr["service_project_id"].ToString();
row.Cells["p_setInfo_id"].Value = dr["setInfo_id"].ToString();
row.Cells["setInfo_projrct_id"].Value = dr["id"].ToString();
if (dr["service_project_discount"].ToString() != "")
{
int iValue = Convert.ToInt32(dr["service_project_discount"].ToString());
bool bln = false;
decimal quota_price = 0;
string strquota_price = Utility.Common.Validator.IsDecimal(dr["quota_price"].ToString(), 10, 2, ref bln);
if (bln)
{
quota_price = Convert.ToDecimal(strquota_price);
decimal discount_price = Math.Abs(Math.Round((quota_price * iValue) / 100, 2));
row.Cells["project_discount_price"].Value = discount_price.ToString();
}
else
{
row.Cells["project_discount_price"].Value = "";
}
}
}
}
}
示例14: UCOrganizationView_Load
private void UCOrganizationView_Load(object sender, EventArgs e)
{
//base.RoleButtonStstus(uc.Name);//角色按钮权限-是否隐藏
base.SetBtnStatus(wStatus);
DataSources.BindComBoxDataEnum(cbostate, typeof(DataSources.EnumStatus), true);//绑定状态 启用 停用
BindTree();
string strSql="SELECT o.*,(select USER_NAME from sys_user where user_id =o.create_by )as create_Username , "
+"(select USER_NAME from sys_user where user_id =o.update_by ) as update_username FROM tb_organization o where org_id='"+id+"'";
SQLObj sqlobj=new SQLObj();
sqlobj.cmdType=CommandType.Text;
sqlobj.Param=new Dictionary<string,ParamObj>();
sqlobj.sqlString=strSql;
DataSet ds= DBHelper.GetDataSet("查询组织", sqlobj);
//DBHelper.GetTable("查询组织", "tb_organization", "*", "org_id='" + id + "'", "", "");
if (ds ==null || ds.Tables[0].Rows.Count <= 0)
{
MessageBoxEx.Show("查询组织失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
DataTable dt = ds.Tables[0];
CommonCtrl.SelectTreeView(tvCompany, dt.Rows[0]["parent_id"].ToString());
lblporg_code.Text = tvCompany.SelectedNode.Name;
lblporg_name.Text = tvCompany.SelectedNode.Text;
lblorg_code.Text = dt.Rows[0]["org_code"].ToString();
lblorg_name.Text = dt.Rows[0]["org_name"].ToString();
lblorg_short_name.Text = dt.Rows[0]["org_short_name"].ToString();
lblremark.Text = dt.Rows[0]["remark"].ToString();
lblcontact_name.Text = dt.Rows[0]["contact_name"].ToString();
lblcontact_telephone.Text = dt.Rows[0]["contact_telephone"].ToString();
lblcreate_Username.Text = dt.Rows[0]["create_Username"].ToString();
lblcreate_time.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(dt.Rows[0]["create_time"].ToString())).ToString();
lblupdate_username.Text = dt.Rows[0]["update_username"].ToString();
lblupdate_time.Text = Common.UtcLongToLocalDateTime(Convert.ToInt64(dt.Rows[0]["update_time"].ToString())).ToString();
cbostate.SelectedValue = dt.Rows[0]["status"].ToString();
}
示例15: GetAdvance
/// <summary>
/// 获取预收/付余额
/// </summary>
/// <param name="custID">往来单位单位ID</param>
/// <param name="orderType">单据类型</param>
/// <returns></returns>
public static decimal GetAdvance(string custID, DataSources.EnumOrderType orderType)
{
SYSModel.SQLObj sql = new SYSModel.SQLObj();
sql.cmdType = CommandType.StoredProcedure;
if (orderType == DataSources.EnumOrderType.PAYMENT)
{
sql.sqlString = "p_yufu_yu_e";
}
else
{
sql.sqlString = "p_yushou_yu_e";
}
sql.Param = new Dictionary<string, ParamObj>();
sql.Param.Add("cust_id", new ParamObj("cust_id", custID, SysDbType.VarChar, 40));
DataSet ds = DBHelper.GetDataSet("查询往来余额", sql);
if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0 || ds.Tables[0].Rows[0][0] == DBNull.Value)
{
return 0;
}
else
{
return Convert.ToDecimal(ds.Tables[0].Rows[0][0]);
}
}