private void btnUpdateCompany() { //添加单位 if (txtCompanyName.Text.Trim().Length == 0) { Popup("请输入单位名称"); return; } // if (txtPrepayFee.Text.Trim().Length == 0) // { // txtPrepayFee.Text = "0"; // } // if (!IsNumeric(txtPrepayFee.Text.Trim())) // { // Popup("请输入正确金额,如:22"); // return; // } try { string strSql = "select * from tbMebCompanyPrepay where cnvcCompanyName = '" + txtCompanyName.Text + "'"; DataTable dtCompany = ReportQueryFacade.CommonQuery(strSql); if (dtCompany.Rows.Count > 1) { throw new Exception("同名单位已存在,请重新输入单位名称!"); } UpdateCompany(); Popup("修改单位成功!"); //btnCancel_Click(null,null); } catch (System.Exception ex) { Popup(ex.Message); } }
// private void BindDept(DropDownList ddl) // { // DataTable dtDept = DeptFacade.GetAllDept(); // ddl.DataSource = dtDept; // ddl.DataTextField = "cnvcDeptName"; // ddl.DataValueField = "cnvcDeptID"; // ddl.DataBind(); // ListItem li = new ListItem("所有","%"); // ddl.Items.Insert(0,li); // } private DataTable GetData(string strDeptID, string strBeginDate, string strEndDate) { string strSql = "select '' as cnnSerialNo,cnvcDeptName,cnvcGoodsType+cnvcGoodsName as cnvcNameType,cnnStorageCount,cnnLoseCount,cnnCount,cnvcOperName,cndOperDate from tbOilStorageCheck where cnvcDeptID like '" + strDeptID + "%'"; if (strBeginDate != "") { strSql += " and convert(char(10),cndOperDate,120)>='" + strBeginDate + "'"; } if (strEndDate != "") { strSql += " and convert(char(10),cndOperDate,120)<='" + strEndDate + "'"; } strSql += " order by cndOperDate desc"; DataTable dtStorage = ReportQueryFacade.CommonQuery(strSql); int i = 0; foreach (DataRow drStorage in dtStorage.Rows) { i++; drStorage["cnnSerialNo"] = i; } dtStorage.Columns["cnnSerialNo"].ColumnName = "序号"; dtStorage.Columns["cnvcDeptName"].ColumnName = "部门名称"; dtStorage.Columns["cnvcNameType"].ColumnName = "型号规格"; dtStorage.Columns["cnnStorageCount"].ColumnName = "库存数量"; dtStorage.Columns["cnnLoseCount"].ColumnName = "损耗数量"; dtStorage.Columns["cnnCount"].ColumnName = "库存实际数"; dtStorage.Columns["cnvcOperName"].ColumnName = "操作员"; dtStorage.Columns["cndOperDate"].ColumnName = "操作时间"; return(dtStorage); }
// private void BindDept(DropDownList ddl) // { // DataTable dtDept = DeptFacade.GetAllDept(); // ddl.DataSource = dtDept; // ddl.DataTextField = "cnvcDeptName"; // ddl.DataValueField = "cnvcDeptID"; // ddl.DataBind(); // ListItem li = new ListItem("所有","%"); // ddl.Items.Insert(0,li); // } private DataTable GetData(string strDeptID, string strDeptName, string strBeginDate, string strEndDate, string strDeliveryCompany, string strContractNo, ref string strDeliveryCompanyFact, ref string strContractNoFact) { string strSql = "select cnvcBillNo,cnvcGoodsName,cnvcGoodsType,cnvcUnit,cnnCount,cnnSpecialUnitPrice,cnnSpecialFee,'' as cnvcComments,cnvcDeliveryCompany,cnvcContractNo,cndDeliveryDate,cnvcOperName,cndOperDate," + " '{0}FuncName={1}&BillNo='+cnvcBillNo+'&DeptID='+cnvcDeptID+'{2}' as cnvcMod " + " from tbBillOfMaterials where cnvcDeptID like '" + strDeptID + "%'"; if (strBeginDate != "") { strSql += " and cndDeliveryDate>='" + strBeginDate + "'"; } if (strEndDate != "") { strSql += " and cndDeliveryDate<='" + strEndDate + "'"; } if (strDeliveryCompany != "") { strSql += " and cnvcDeliveryCompany like '%" + strDeliveryCompany + "%'"; } if (strContractNo != "") { strSql += " and cnvcContractNo = '" + strContractNo + "'"; } strSql += " order by cndOperDate desc"; DataTable dtBillOfMaterials = ReportQueryFacade.CommonQuery(strSql); //算合计 double dCount = 0.00; double dFee = 0.00; strDeliveryCompanyFact = ""; strContractNoFact = ""; foreach (DataRow drBillOfMaterials in dtBillOfMaterials.Rows) { dCount += double.Parse(drBillOfMaterials["cnnCount"].ToString()); dFee += double.Parse(drBillOfMaterials["cnnSpecialFee"].ToString()); strDeliveryCompanyFact = drBillOfMaterials["cnvcDeliveryCompany"].ToString(); strContractNoFact = drBillOfMaterials["cnvcContractNo"].ToString(); } DataRow drNew = dtBillOfMaterials.NewRow(); drNew["cnvcGoodsType"] = "合计"; drNew["cnnCount"] = Math.Round(dCount, 2); drNew["cnnSpecialFee"] = Math.Round(dFee, 2); dtBillOfMaterials.Rows.Add(drNew); dtBillOfMaterials.Columns["cnvcBillNo"].ColumnName = "领料单号"; dtBillOfMaterials.Columns["cnvcGoodsName"].ColumnName = "物资名称"; dtBillOfMaterials.Columns["cnvcGoodsType"].ColumnName = "规格型号"; dtBillOfMaterials.Columns["cnvcUnit"].ColumnName = "单位"; dtBillOfMaterials.Columns["cnnCount"].ColumnName = "供应数量"; dtBillOfMaterials.Columns["cnnSpecialUnitPrice"].ColumnName = "专供单价(元)"; dtBillOfMaterials.Columns["cnnSpecialFee"].ColumnName = "专供金额(元)"; dtBillOfMaterials.Columns["cnvcComments"].ColumnName = "备注"; dtBillOfMaterials.Columns["cndDeliveryDate"].ColumnName = "提货时间"; dtBillOfMaterials.Columns["cnvcOperName"].ColumnName = "操作员"; dtBillOfMaterials.Columns["cndOPerDate"].ColumnName = "操作时间"; dtBillOfMaterials.Columns["cnvcMod"].ColumnName = "修改"; dtBillOfMaterials.Columns.Remove("cnvcDeliveryCompany"); dtBillOfMaterials.Columns.Remove("cnvcContractNo"); return(dtBillOfMaterials); }
private void BindRegister() { DataTable dtRegister = ReportQueryFacade.CommonQuery("select * from tbRegister order by cndOperDate"); this.DataGrid1.DataSource = dtRegister; this.DataGrid1.DataBind(); }
private DataTable GetFillFee() { //充值查询 //string strSql = "select * from tbFillFee where 1=1"; string strSql = "select a.* from tbFillFee a left join tbMebCompanyPrepay b on a.cnvcCompanyID=b.cnvcCompanyID where 1=1"; if (txtCompanyName.Text != "") { strSql += " and b.cnvcCompanyName like '%" + txtCompanyName.Text + "%'"; } if (txtOperName.Text != "") { strSql += " and a.cnvcOperName like '%" + txtOperName.Text + "%'"; } if (txtBeginDate.Text != "") { strSql += " and convert(char(10),a.cndOperDate,120) >= '" + txtBeginDate.Text + "'"; } if (txtEndDate.Text != "") { strSql += " and convert(char(10),a.cndOperDate,120) <= '" + txtEndDate.Text + "'"; } strSql += " and a.cnvcDeptID like '" + ddlDept.SelectedValue + "%'"; strSql += " order by a.cndOperDate"; DataTable dtFillFee = ReportQueryFacade.CommonQuery(strSql); return(dtFillFee); }
private void DataGrid1_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { //(TextBox)(e.Item.Cells[2].Controls[0])).Text //Popup(e.Item.Cells[2].Text); //Popup(((TextBox)e.Item.Cells[3].Controls[0]).Text); string strHddSerial = e.Item.Cells[2].Text; string strRegister = ((TextBox)e.Item.Cells[3].Controls[0]).Text; if (strRegister.Trim() == "") { Popup("请输入注册码"); return; } try { ReportQueryFacade.CommonQuery("update tbRegister set cnvcRegister='" + strRegister + "' where cnvcHddSerialNo='" + strHddSerial + "'"); Popup("注册成功!"); } catch (System.Exception ex) { Popup(ex.Message); } this.DataGrid1.EditItemIndex = -1; this.BindRegister(); }
public EntityObjectBase LoadObj(string strType) { string strBillNo = this.Request["BillNo"].ToString(); string strDeptID = this.Request["DeptID"].ToString(); EntityObjectBase eob = null; switch (strType) { case "BOM": BillOfMaterials bom = new BillOfMaterials(); bom.cnvcBillNo = strBillNo; bom.cnvcDeptID = strDeptID; eob = ReportQueryFacade.CommonQuery(bom); break; case "BOV": BillOfValidate bov = new BillOfValidate(); bov.cnvcBillNo = strBillNo; bov.cnvcDeptID = strDeptID; eob = ReportQueryFacade.CommonQuery(bov); break; case "BOS": BillOfOutStorage bos = new BillOfOutStorage(); bos.cnvcBillNo = strBillNo; bos.cnvcDeptID = strDeptID; eob = ReportQueryFacade.CommonQuery(bos); break; } return(eob); }
private void ddlGoodsName_SelectedIndexChanged(object sender, System.EventArgs e) { //ddlGoodsName_SelectedIndexChanged // DataTable dtGoodsType = ReportQueryFacade.CommonQuery("select * from tbCommCode where cnvcCommSign='GoodsType"+ddlGoodsName.SelectedValue+"'"); // ddlGoodsType.DataSource = dtGoodsType; // ddlGoodsType.DataTextField = "cnvcCommName"; // ddlGoodsType.DataValueField = "cnvcCommCode"; // ddlGoodsType.DataBind(); ListItem liAll = new ListItem("所有", "%"); //ddlGoodsName.Items.Insert(0,liAll); if (ddlGoodsName.SelectedItem.Text != "所有") { DataTable dtGoodsType = ReportQueryFacade.CommonQuery("select * from tbCommCode where cnvcCommSign='GoodsType" + ddlGoodsName.SelectedValue + "'"); ddlGoodsType.DataSource = dtGoodsType; ddlGoodsType.DataTextField = "cnvcCommName"; ddlGoodsType.DataValueField = "cnvcCommCode"; ddlGoodsType.DataBind(); } else { DataTable dtGoodsType = ReportQueryFacade.CommonQuery("select * from tbCommCode where cnvcCommSign='GoodsTypeCY' or cnvcCommSign='GoodsTypeQY'"); ddlGoodsType.DataSource = dtGoodsType; ddlGoodsType.DataTextField = "cnvcCommName"; ddlGoodsType.DataValueField = "cnvcCommCode"; ddlGoodsType.DataBind(); } //ListItem li = new ListItem("所有","%"); ddlGoodsType.Items.Insert(0, liAll); }
public static void FillTree(TreeView tv, bool haveOper) { DataTable dtOper = ReportQueryFacade.CommonQuery("select * from tbOper order by cnvcOpername"); //"OperFacade.GetAllOper(); DataTable dtDept = ReportQueryFacade.CommonQuery("select * from tbDept order by cnvcDeptName"); //OperFacade.GetAllDept(); //最高级部门 TreeNode tnTop = new TreeNode(); tnTop.ID = "dept_00"; tnTop.Type = "dept"; tnTop.Text = CommonStatic.EnterpriseFullName(); if (haveOper) { DataRow[] drOpers = dtOper.Select("cnvcDeptID=00"); foreach (DataRow drOper in drOpers) { Oper oper = new Oper(drOper); TreeNode tnOper = OperNode(oper); tnTop.Nodes.Add(tnOper); } } //一级部门 DataRow[] drDepts = dtDept.Select("cnvcParentDeptID=00"); foreach (DataRow drDept in drDepts) { Dept dept = new Dept(drDept); TreeNode tnDept = DeptNode(dept); FillNode(dtDept, dtOper, tnDept, dept.cnvcDeptID, haveOper); tnTop.Nodes.Add(tnDept); } tv.Nodes.Add(tnTop); }
private void Page_Load(object sender, System.EventArgs e) { // 在此处放置用户代码以初始化页面 //this.btnExcel.Attributes.Add("onclick","javascript:window.open('DataGridToExcel.aspx', 'Sample', 'toolbar=no,location=no,directories=no,status=yes,menubar=yes,scrollbars=no,resizable=yes,copyhistory=yes,width=790,height=520,left=0,top=0')"); if (!IsPostBack) { //BindDeptAll(ddlProvideCompany); BindDept(ddlProvideCompany, "所有", "%"); BindDeptAll(ddlDeliveryCompany); UcPageView1.DebindGrid(); DataTable dtGoodsName = ReportQueryFacade.CommonQuery("select * from tbCommCode where cnvcCommSign='GoodsName'"); ddlGoodsName.DataSource = dtGoodsName; ddlGoodsName.DataTextField = "cnvcCommName"; ddlGoodsName.DataValueField = "cnvcCommCode"; ddlGoodsName.DataBind(); ListItem liAll = new ListItem("所有", "%"); ddlGoodsName.Items.Insert(0, liAll); if (ddlGoodsName.SelectedItem.Text != "所有") { DataTable dtGoodsType = ReportQueryFacade.CommonQuery("select * from tbCommCode where cnvcCommSign='GoodsType" + ddlGoodsName.SelectedValue + "'"); ddlGoodsType.DataSource = dtGoodsType; ddlGoodsType.DataTextField = "cnvcCommName"; ddlGoodsType.DataValueField = "cnvcCommCode"; ddlGoodsType.DataBind(); } else { DataTable dtGoodsType = ReportQueryFacade.CommonQuery("select * from tbCommCode where cnvcCommSign='GoodsTypeCY' or cnvcCommSign='GoodsTypeQY'"); ddlGoodsType.DataSource = dtGoodsType; ddlGoodsType.DataTextField = "cnvcCommName"; ddlGoodsType.DataValueField = "cnvcCommCode"; ddlGoodsType.DataBind(); } //ListItem li = new ListItem("所有","%"); ddlGoodsType.Items.Insert(0, liAll); // if ( null != Session[ConstValue.LOGIN_DEPT_SESSION]) // { // Dept dept = (Dept)Session[ConstValue.LOGIN_DEPT_SESSION]; // if (dept.cnvcDeptID != "00") // { // ListItem li = ddlDeliveryCompany.Items.FindByText(dept.cnvcDeptName); // ddlDeliveryCompany.SelectedIndex = ddlDeliveryCompany.Items.IndexOf(li); // ddlDeliveryCompany.Enabled = false; // //// ListItem li2 = ddlProvideCompany.Items.FindByText(dept.cnvcDeptName); //// ddlProvideCompany.SelectedIndex = ddlProvideCompany.Items.IndexOf(li2); //// ddlProvideCompany.Enabled = false; // } // } } }
bool AddDept() { string strDeptID = ""; if (txtDeptName.Text.Length == 0) { alertControl.Enable = true; alertControl.Msg = "请输入部门名称"; return(false); } try { //Dept getDept = new Dept(); //getDept.cnvcDeptID = this.hidParentID.Value; //Dept deptParent = DeptFacade.GetDept(getDept);//BaseSqlMapDao.ExecuteQueryForObject("Dept.Select",this.hidParentID.Value) as ynhnOilManage.Common.Dept; DataTable dtCount = ReportQueryFacade.CommonQuery("select * from tbDept where cnvcDeptName = '" + this.txtDeptName.Text + "'"); if (dtCount.Rows.Count > 0) { throw new Exception("同名部门已存在,请添加新部门!"); } strDeptID = DeptFacade.GetDeptID(this.hidParentID.Value); Dept dept = new Dept(); dept.cnvcDeptID = strDeptID; dept.cnvcParentDeptID = this.hidParentID.Value; dept.cnbValidate = this.chkValidate.Checked; dept.cnvcDeptName = this.txtDeptName.Text; Dept curDept = Session[ConstValue.LOGIN_DEPT_SESSION] as Dept; Oper curOper = Session[ConstValue.LOGIN_USER_SESSION] as Oper; BusiLog busiLog = new BusiLog(); busiLog.cndOperDate = DateTime.Now; busiLog.cnnSerial = Guid.NewGuid(); busiLog.cnvcOperName = curOper.cnvcOperName; busiLog.cnvcComments = "添加部门:" + this.txtDeptName.Text; busiLog.cnvcDeptID = curDept.cnvcDeptID; busiLog.cnvcDeptName = curDept.cnvcDeptName; busiLog.cnvcOperType = "BS001"; busiLog.cnvcSource = "网站"; DeptFacade.AddDept(dept, busiLog); } catch (Exception ex) { alertControl.Enable = true; alertControl.Msg = ex.Message; return(false); } //成功添加部门 alertControl.Action = AlertControl.ACTION.Script; alertControl.Enable = true; alertControl.Msg = "成功添加部门"; alertControl.Script = string.Format("window.parent.OnAddNodeResult('{0}','{1}','{2}');", "dept_" + hidParentID.Value, "dept_" + strDeptID, txtDeptName.Text); return(true); }
private DataTable GetCompany() { //单位查询 string strSql = "select a.*,'' as cnnFillFee,b.cnnFillFeeSum from tbMebCompanyPrepay a left outer join "; strSql += "(select cnvcCompanyID,cnvcAcctID,cnvcDeptID, " + " sum(cnnFillFee) cnnFillFeeSum from tbFillFee where 1=1"; if (txtBeginDate.Text != "") { strSql += " and convert(char(10),isnull(cndOperDate,''),120)>='" + txtBeginDate.Text + "'"; } if (txtEndDate.Text != "") { strSql += " and convert(char(10),isnull(cndOperDate,''),120)<='" + txtEndDate.Text + "'"; } strSql += " group by cnvcCompanyID,cnvcAcctID,cnvcDeptID ) b on"; strSql += " a.cnvcCompanyID=b.cnvcCompanyID and a.cnvcAcctID=b.cnvcAcctID and a.cnvcDeptID=b.cnvcDeptID "; strSql += " where 1=1 "; if (txtCompanyName.Text != "") { strSql += " and a.cnvcCompanyName like '%" + txtCompanyName.Text + "%'"; } strSql += " and a.cnvcDeptID like '" + ddlDept.SelectedValue + "%'"; strSql += " order by a.cnvcCompanyName"; DataTable dtCompany = ReportQueryFacade.CommonQuery(strSql); decimal dPrepayFee = 0; decimal dFillfeeSum = 0; foreach (DataRow dr in dtCompany.Rows) { if (System.DBNull.Value == dr["cnnPrepayFee"]) { dPrepayFee += 0; } else { dPrepayFee += Convert.ToDecimal(dr["cnnPrepayFee"]); } if (System.DBNull.Value == dr["cnnFillFeeSum"]) { dFillfeeSum += 0; } else { dFillfeeSum += Convert.ToDecimal(dr["cnnFillFeeSum"]); } } DataRow drNew = dtCompany.NewRow(); drNew["cnvcCompanyName"] = "合计:"; drNew["cnnPrepayFee"] = dPrepayFee; drNew["cnnFIllFeeSum"] = dFillfeeSum; dtCompany.Rows.Add(drNew); return(dtCompany); }
public void BindContractNo(DropDownList ddl, string LocalDeptNameTmp, string strDeliveryCompany) { string strsql = "select cnvcContractNo,cnvcDeliveryCompany from tbSpecialOilDept where cnvcDeliveryComPany like '" + LocalDeptNameTmp + "%' and cnvcDeliveryComPany='" + strDeliveryCompany + "' order by cnvcDeliveryCompany"; DataTable dt = ReportQueryFacade.CommonQuery(strsql); ddl.DataSource = dt; ddl.DataTextField = "cnvcContractNo"; ddl.DataValueField = "cnvcContractNo"; ddl.DataBind(); }
// public void BindOperType(DropDownList ddl) // { // DataTable dt = ReportQueryFacade.CommonQuery("select * from tbCommCode where cnvcCommSign like 'GoodsType%'"); // ddl.DataSource = dtDept; // ddl.DataTextField = "cnvcDeptName"; // ddl.DataValueField = "cnvcDeptID"; // ddl.DataBind(); // ListItem li = new ListItem(strText,strValue); // ddl.Items.Insert(0,li); // } public void BindGoodsType(DropDownList ddlGoodsType, string strGoodsName) { //DataTable dtGoodsType = ReportQueryFacade.CommonQuery("select * from tbCommCode where cnvcCommSign='GoodsType"+strGoodsName+"'"); DataTable dtGoodsType = ReportQueryFacade.CommonQuery("select * from tbCommCode where cnvcCommSign like 'GoodsType%'"); ddlGoodsType.DataSource = dtGoodsType; ddlGoodsType.DataTextField = "cnvcCommName"; ddlGoodsType.DataValueField = "cnvcCommCode"; ddlGoodsType.DataBind(); }
public void BindPDept(DropDownList ddl, string LocalDeptNameTmp) { string strsql = "select * from tbDept where isnull(cnvcLocalFlag,'')<>'" + LocalDeptNameTmp + "'"; DataTable dt = ReportQueryFacade.CommonQuery(strsql); ddl.DataSource = dt; ddl.DataTextField = "cnvcDeptName"; ddl.DataValueField = "cnvcDeptID"; ddl.DataBind(); }
public void BindGoodsName(DropDownList ddlGoodsName) { DataTable dtGoodsName = ReportQueryFacade.CommonQuery("select * from tbCommCode where cnvcCommSign='GoodsName'"); ddlGoodsName.DataSource = dtGoodsName; ddlGoodsName.DataTextField = "cnvcCommName"; ddlGoodsName.DataValueField = "cnvcCommCode"; ddlGoodsName.DataBind(); }
private DataTable GetData(string strCompanyName, string strDeptID, string strBeginDate, string strEndDate) { string strSql = "select a.cnvcCompanyName,a.cnvcDeptName,a.cnnFillFee,b.cnnPrepayFee,a.cnvcOperName,a.cndOperDate from tbFillFee a left outer join tbMebCompanyPrepay b on a.cnvcAcctID=b.cnvcAcctID where 1=1"; if (strDeptID != "") { strSql += " and a.cnvcDeptID like '" + strDeptID + "%'"; } // if ( null != Session[ConstValue.LOGIN_DEPT_SESSION]) // { // Dept dept = (Dept)Session[ConstValue.LOGIN_DEPT_SESSION]; // if (dept.cnvcDeptID != "00") // { // strSql += " and a.cnvcDeptID ='"+dept.cnvcDeptID+"'"; // } // } if (strCompanyName != "") { strSql += " and a.cnvcCompanyName like '%" + strCompanyName + "%'"; } if (strBeginDate != "") { strSql += " and convert(char(10),a.cndOperDate,120)>='" + strBeginDate + "'"; } if (strEndDate != "") { strSql += " and convert(char(10),a.cndOperDate,120)<='" + strEndDate + "'"; } strSql += " order by a.cndOperDate desc"; DataTable dtMember = ReportQueryFacade.CommonQuery(strSql); double dFillFee = 0.00; double dPrepayFee = 0.00; foreach (DataRow dr in dtMember.Rows) { dFillFee += Convert.ToDouble(dr["cnnFillFee"]); dPrepayFee += Convert.ToDouble(dr["cnnPrepayFee"]); } DataRow drNew = dtMember.NewRow(); drNew["cnvcDeptName"] = "合计:"; drNew["cnnFillFee"] = dFillFee; drNew["cnnPrepayFee"] = dPrepayFee; dtMember.Rows.Add(drNew); dtMember.Columns["cnvcCompanyName"].ColumnName = "单位名称"; dtMember.Columns["cnvcDeptName"].ColumnName = "指定加油站"; dtMember.Columns["cnnFillFee"].ColumnName = "充值金额"; dtMember.Columns["cnnPrepayFee"].ColumnName = "单位余额"; dtMember.Columns["cnvcOperName"].ColumnName = "操作员"; dtMember.Columns["cndOperDate"].ColumnName = "充值日期"; return(dtMember); }
public void BindLocalDept(TextBox txtDeptID, TextBox txtDeptName) { string strDeptID = this.Request["DeptID"].ToString(); string strsql = "select cnvcDeptID,SUBSTRING(cnvcdeptname,1,3) as cnvcDeptName,cnvcParentDeptID,cnvcLocalFlag,cnbValidate from tbdept where cnvcdeptid='" + strDeptID + "'"; DataTable dt = ReportQueryFacade.CommonQuery(strsql); Dept dept = new Dept(dt); txtDeptID.Text = strDeptID; txtDeptName.Text = dept.cnvcDeptName; }
bool UpdateOper() { if (txtOperName.Text.Length == 0) { alertControl.Enable = true; alertControl.Msg = "请输入操作员姓名"; return(false); } try { DataTable dtCount = ReportQueryFacade.CommonQuery("select * from tbOper where cnvcOperName = '" + this.txtOperName.Text + "'"); if (dtCount.Rows.Count > 1) { throw new Exception("同名操作员已存在,请修改操作员名称!"); } dtCount = ReportQueryFacade.CommonQuery("select * from tbOper where cnnOperID = " + this.txtOperID.Text); if (dtCount.Rows.Count == 0) { throw new Exception("操作员信息获取错误!"); } Oper oper = new Oper(dtCount); //oper.cnnOperID = int.Parse(this.txtOperID.Text); oper.cnvcOperName = this.txtOperName.Text; oper.cnbValidate = this.chkValidate.Checked; Dept curDept = Session[ConstValue.LOGIN_DEPT_SESSION] as Dept; Oper curOper = Session[ConstValue.LOGIN_USER_SESSION] as Oper; BusiLog busiLog = new BusiLog(); busiLog.cndOperDate = DateTime.Now; busiLog.cnnSerial = Guid.NewGuid(); busiLog.cnvcOperName = curOper.cnvcOperName; busiLog.cnvcComments = "修改操作员名称:" + this.txtOperName.Text; busiLog.cnvcDeptID = curDept.cnvcDeptID; busiLog.cnvcDeptName = curDept.cnvcDeptName; busiLog.cnvcOperType = "BS006"; busiLog.cnvcSource = "网站"; OperFacade.UpdatePwd(oper, busiLog); } catch (Exception ex) { alertControl.Enable = true; alertControl.Msg = ex.Message; return(false); } alertControl.Enable = true; alertControl.Action = AlertControl.ACTION.Script; alertControl.Msg = "成功更新操作员属性"; alertControl.Script = string.Format("window.parent.OnChangeNodeResult('{0}','{1}');", "oper_" + txtOperID.Text, txtOperName.Text); return(true); }
private void BindCompany() { string strSql = "select *,cnvcContractNo as cnvcID,cnvcDeliveryCompany as cnvcName from tbSpecialOilDept where 1=1"; strSql += " and cnvcContractNo like '%" + txtContactNo.Text + "%'"; strSql += " and cnvcDeliveryCompany like '%" + txtDeliveryCompany.Text + "%'"; strSql += " order by cnvcContractNo,cnvcDeliveryCompany"; DataTable dtCompany = ReportQueryFacade.CommonQuery(strSql); this.dgCompany.DataSource = dtCompany; this.dgCompany.DataBind(); }
// private void BindDept(DropDownList ddl) // { // DataTable dtDept = DeptFacade.GetAllDept(); // ddl.DataSource = dtDept; // ddl.DataTextField = "cnvcDeptName"; // ddl.DataValueField = "cnvcDeptID"; // ddl.DataBind(); // ListItem li = new ListItem("所有","%"); // ddl.Items.Insert(0,li); // } private void BindState(DropDownList ddl) { DataTable dtState = ReportQueryFacade.CommonQuery("select * from tbCommCode where cnvcCommSign='MemState'"); ddl.DataSource = dtState; ddl.DataTextField = "cnvcCommName"; ddl.DataValueField = "cnvcCommCode"; ddl.DataBind(); ListItem li = new ListItem("所有", "%"); ddl.Items.Insert(0, li); }
private void btnOK_Click(object sender, System.EventArgs e) { //添加 if (txtContactNo.Text.Trim().Length == 0) { Popup("请输入合同编号!"); return; } if (txtDeliveryCompany.Text.Trim().Length == 0) { Popup("请输入单位名称!"); return; } string strContractSql = "select * from tbSpecialOilDept where cnvcContractNo='" + txtContactNo.Text + "' "; string strDeliveryCompany = "select * from tbSpecialOilDept where cnvcDeliveryCompany = '" + txtDeliveryCompany.Text + "'"; DataTable dtContract = ReportQueryFacade.CommonQuery(strContractSql); DataTable dtDeliveryCompany = ReportQueryFacade.CommonQuery(strDeliveryCompany); if (dtContract.Rows.Count > 0) { Popup("相同的合同编号已存在!"); return; } if (dtDeliveryCompany.Rows.Count > 0) { Popup("相同的单位名称已存在!"); return; } SpecialOilDept specialOilDept = new SpecialOilDept(); specialOilDept.cnvcContractNo = txtContactNo.Text; specialOilDept.cnvcDeliveryCompany = txtDeliveryCompany.Text; Dept curDept = Session[ConstValue.LOGIN_DEPT_SESSION] as Dept; Oper curOper = Session[ConstValue.LOGIN_USER_SESSION] as Oper; BusiLog busiLog = new BusiLog(); busiLog.cndOperDate = DateTime.Now; busiLog.cnnSerial = Guid.NewGuid(); busiLog.cnvcOperName = curOper.cnvcOperName; busiLog.cnvcComments = "添加领用单位:" + txtContactNo.Text + "|" + txtDeliveryCompany.Text; busiLog.cnvcDeptID = curDept.cnvcDeptID; busiLog.cnvcDeptName = curDept.cnvcDeptName; busiLog.cnvcOperType = "BS013"; busiLog.cnvcSource = "网站"; SpecialOilFacade.AddSpecialOilDept(specialOilDept, busiLog); Popup("领用单位添加成功"); }
public double GetOffSet() { string strsql = "select * from tbCommCode where cnvcCommSign='OFFSET'"; DataTable dt = ReportQueryFacade.CommonQuery(strsql); if (dt.Rows.Count > 0) { return(double.Parse(dt.Rows[0]["cnvccommcode"].ToString())); } else { return(0); } }
bool UpdateDept() { if (txtDeptName.Text.Length == 0) { alertControl.Enable = true; alertControl.Msg = "请输入部门名称"; return(false); } try { DataTable dtCount = ReportQueryFacade.CommonQuery("select * from tbDept where cnvcDeptName = '" + this.txtDeptName.Text + "'"); if (dtCount.Rows.Count > 1) { throw new Exception("同名部门已存在,请添加新部门!"); } Dept dept = new Dept(); dept.cnvcDeptID = this.txtDeptID.Text; dept.cnvcDeptName = this.txtDeptName.Text; dept.cnvcParentDeptID = this.hidParentID.Value; dept.cnbValidate = this.chkValidate.Checked; Dept curDept = Session[ConstValue.LOGIN_DEPT_SESSION] as Dept; Oper curOper = Session[ConstValue.LOGIN_USER_SESSION] as Oper; BusiLog busiLog = new BusiLog(); busiLog.cndOperDate = DateTime.Now; busiLog.cnnSerial = Guid.NewGuid(); busiLog.cnvcOperName = curOper.cnvcOperName; busiLog.cnvcComments = "修改部门名称为:" + this.txtDeptName.Text; busiLog.cnvcDeptID = curDept.cnvcDeptID; busiLog.cnvcDeptName = curDept.cnvcDeptName; busiLog.cnvcOperType = "BS002"; busiLog.cnvcSource = "网站"; DeptFacade.UpdateDept(dept, busiLog); } catch (Exception ex) { alertControl.Enable = true; alertControl.Msg = ex.Message; return(false); } //成功更新部门 alertControl.Action = AlertControl.ACTION.Script; alertControl.Enable = true; alertControl.Msg = "成功更新部门信息"; alertControl.Script = string.Format("window.parent.OnChangeNodeResult('{0}','{1}');", "dept_" + txtDeptID.Text, txtDeptName.Text); return(true); }
private void LoadComponent(string strcompanyid) { string strsql = "select * from tbMebCompanyPrepay where cnvccompanyid='" + strcompanyid + "'"; DataTable dt = ReportQueryFacade.CommonQuery(strsql); if (dt.Rows.Count != 1) { throw new Exception("不能获取到单位"); } MebCompanyPrepay mcp = new MebCompanyPrepay(dt); this.txtCompanyID.Text = mcp.cnvcCompanyID.ToString(); this.txtCompanyName.Text = mcp.cnvcCompanyName; this.chkValidate.Checked = mcp.cnbValidate; }
private void ddlDept_SelectedIndexChanged(object sender, System.EventArgs e) { //显示最新油价 string strSql = "select top 1 * from tbOilPrice where cnvcDeptName = '" + ddlDept.SelectedItem.Text + "' and cnvcGoodsName='" + ddlGoodsName.SelectedItem.Text + "' and cnvcGoodsType='" + ddlGoodsType.SelectedItem.Text + "' order by cndPriceDate desc,cnnSerialNo desc"; DataTable dtOilPrice = ReportQueryFacade.CommonQuery(strSql); if (dtOilPrice.Rows.Count > 0) { OilPrice price = new OilPrice(dtOilPrice); txtOilPrice1.Text = price.cnnOilPrice.ToString(); txtGoodsName1.Text = price.cnvcGoodsName; txtGoodsType1.Text = price.cnvcGoodsType; txtUnit1.Text = price.cnvcUnit; txtPriceDate1.Text = price.cndPriceDate.ToString("yyyy-MM-dd"); } }
private void FillOperRbl(string strDeptID) { try { //DataTable dtAllOper = OperFacade.GetAllOperNoAdmin(); DataTable dtOper = ReportQueryFacade.CommonQuery("select * from tbOper where cnvcOperName <>'admin' and cnvcDeptID like '" + strDeptID + "%' order by cnvcOperName"); rblOper.DataSource = dtOper; rblOper.DataTextField = "cnvcOperName"; rblOper.DataValueField = "cnnOperID"; rblOper.DataBind(); } catch (BusinessException bex) { Popup(bex.Message); } }
private void Button1_Click(object sender, System.EventArgs e) { try { //根据新油价重算 if (this.txtBeginDate.Text.Trim().Length == 0) { this.Popup("请输入开始日期!"); return; } if (this.txtEndDate.Text.Trim().Length == 0) { this.Popup("请输入结束日期!"); return; } DataTable dtPrice = ReportQueryFacade.CommonQuery("select count(*) from tbOilPrice where convert(varchar(10),cndpricedate,121) between '" + this.txtBeginDate.Text + "' and '" + this.txtEndDate.Text + "'"); int icount = Convert.ToInt32(dtPrice.Rows[0][0].ToString()); if (icount == 0) { this.Popup("选定的时间段油价未变动!"); return; } Dept curDept = Session[ConstValue.LOGIN_DEPT_SESSION] as Dept; Oper curOper = Session[ConstValue.LOGIN_USER_SESSION] as Oper; BusiLog busiLog = new BusiLog(); busiLog.cnvcOperName = curOper.cnvcOperName; busiLog.cnvcComments = "重算:" + this.txtBeginDate.Text + "-" + this.txtEndDate.Text; busiLog.cnvcDeptID = curDept.cnvcDeptID; busiLog.cnvcDeptName = curDept.cnvcDeptName; busiLog.cnvcOperType = "BS016"; busiLog.cnvcSource = "网站"; ReportQueryFacade.AgainComp(this.txtBeginDate.Text, this.txtEndDate.Text, busiLog); this.Popup("重算成功"); } catch (Exception ex) { this.Popup(ex.Message); } }
// private void BindDept(DropDownList ddl) // { // DataTable dtDept = DeptFacade.GetAllDept(); // ddl.DataSource = dtDept; // ddl.DataTextField = "cnvcDeptName"; // ddl.DataValueField = "cnvcDeptID"; // ddl.DataBind(); // ListItem li = new ListItem("所有","%"); // ddl.Items.Insert(0,li); // } private DataTable GetData(string strDeptID, string strDeptName, string strBeginDate, string strEndDate) { string strSql = "select '' as cnnID,cnvcDeliveryCompany,cnvcContractNo,cnvcGoodsName,cnvcGoodsType,cnvcUnit,sum(cnnCount) as cnnCount,cnnSpecialUnitPrice,sum(cnnSpecialFee) as cnnSpecialFee,'' as cnvcComments from tbBillOfMaterials where cnvcDeptID like '" + strDeptID + "%'"; if (strBeginDate != "") { strSql += " and cndDeliveryDate>='" + strBeginDate + "'"; } if (strEndDate != "") { strSql += " and cndDeliveryDate<='" + strEndDate + "'"; } strSql += " group by cnvcDeliveryCompany,cnvcContractNo,cnvcGoodsName,cnvcGoodsType,cnvcUnit,cnnSpecialUnitPrice order by cnvcContractNo,cnvcGoodsType"; DataTable dtBillOfMaterials = ReportQueryFacade.CommonQuery(strSql); //算合计 double dCount = 0.00; double dFee = 0.00; int i = 0; foreach (DataRow drBillOfMaterials in dtBillOfMaterials.Rows) { dCount += double.Parse(drBillOfMaterials["cnnCount"].ToString()); dFee += double.Parse(drBillOfMaterials["cnnSpecialFee"].ToString()); i++; drBillOfMaterials["cnnID"] = i; } DataRow drNew = dtBillOfMaterials.NewRow(); drNew["cnvcDeliveryCompany"] = "合计"; drNew["cnnCount"] = dCount; drNew["cnnSpecialFee"] = dFee; dtBillOfMaterials.Rows.Add(drNew); dtBillOfMaterials.Columns["cnnID"].ColumnName = "序号"; dtBillOfMaterials.Columns["cnvcContractNo"].ColumnName = "合同编号"; dtBillOfMaterials.Columns["cnvcDeliveryCompany"].ColumnName = "领用单位"; dtBillOfMaterials.Columns["cnvcGoodsName"].ColumnName = "物资名称"; dtBillOfMaterials.Columns["cnvcGoodsType"].ColumnName = "规格型号"; dtBillOfMaterials.Columns["cnvcUnit"].ColumnName = "单位"; dtBillOfMaterials.Columns["cnnCount"].ColumnName = "供应数量"; dtBillOfMaterials.Columns["cnnSpecialUnitPrice"].ColumnName = "专供单价(元)"; dtBillOfMaterials.Columns["cnnSpecialFee"].ColumnName = "专供金额(元)"; dtBillOfMaterials.Columns["cnvcComments"].ColumnName = "备注"; return(dtBillOfMaterials); }
// private void BindDept(DropDownList ddl) // { // DataTable dtDept = DeptFacade.GetAllDept(); // ddl.DataSource = dtDept; // ddl.DataTextField = "cnvcDeptName"; // ddl.DataValueField = "cnvcDeptID"; // ddl.DataBind(); // ListItem li = new ListItem("所有","%"); // ddl.Items.Insert(0,li); // } private DataTable GetData(string strDeptID, string strOperName, string strValidate) { string strsql = "select a.cnnOperID,a.cnvcOperName,a.cnvcDeptID,b.cnvcDeptName,case when a.cnbValidate=1 then '有效' when a.cnbValidate=0 then '无效' end as cnbValidate from tbOper a " + " left join tbDept b on a.cnvcDeptID=b.cnvcDeptID " + " where a.cnvcOperName like '%" + strOperName + "%' " + " and a.cnvcDeptID like '%" + strDeptID + "%'"; if (strValidate != "所有") { strsql += " and a.cnbValidate=" + strValidate; } DataTable dt = ReportQueryFacade.CommonQuery(strsql); dt.Columns["cnnOperID"].ColumnName = "操作员ID"; dt.Columns["cnvcOperName"].ColumnName = "操作员姓名"; dt.Columns["cnvcDeptID"].ColumnName = "部门ID"; dt.Columns["cnvcDeptName"].ColumnName = "部门名称"; dt.Columns["cnbValidate"].ColumnName = "是否有效"; return(dt); }