Exemplo n.º 1
0
 protected void ImgModifybtn_Click(object sender, ImageClickEventArgs e)
 {
     try
     {
         string CKDH = this.txtCKDH.Text.Trim();
         string CK   = this.drpFHCK.SelectedValue;
         if (string.IsNullOrEmpty(CKDH))
         {
             this.PrintfError("请选择要修改的单据");
             return;
         }
         int status = QTCKQuery.GetStatus(CKDH);
         if (status > 0)
         {
             this.PrintfError("该单据已经执行,不能修改");
             return;
         }
         this.hidZT.Value = "Modify";
         ChangeStatus();
         DataSet ds = QTCKQuery.GetItem(CKDH);
         Session["QTCKITEM"] = null;
         Session["QTCKITEM"] = ds;
         this.frameItem.Attributes["src"] = "QTCKD_item.aspx?FHCK=" + CK;
     }
     catch
     {
         this.PrintfError("数据访问错误");
         return;
     }
 }
Exemplo n.º 2
0
 protected void imgMDButton_Click(object sender, ImageClickEventArgs e)
 {
     try
     {
         if (string.IsNullOrEmpty(txtCKDH.Text))
         {
             this.PrintfError("请先选择要修改单据");
             return;
         }
         DataSet ds = QTCKQuery.GetQTCKstatus("ckdh", this.txtCKDH.Text);
         if (ds != null)
         {
             if (ds.Tables[0].Rows.Count > 0)
             {
                 this.PrintfError("该单据已经执行,不能修改");
                 return;
             }
         }
     }
     catch
     {
         this.PrintfError("获得单据状态时出错");
         return;
     }
 }
Exemplo n.º 3
0
 protected void ImgCZDJbtn_Click(object sender, ImageClickEventArgs e)
 {
     try
     {
         string CKDH = this.txtCKDH.Text.Trim();
         if (string.IsNullOrEmpty(CKDH))
         {
             this.PrintfError("请选择要重置的单据");
             return;
         }
         int status = QTCKQuery.GetStatus(CKDH);
         if (status > 1)
         {
             this.PrintfError("该单据已经执行完成,不能重置");
             return;
         }
         if (status == 0)
         {
             this.PrintfError("不用重置");
             return;
         }
         string result = QTCKQuery.CZDJ(CKDH);
         if (result != "success")
         {
             this.PrintfError("重置过程出现异常,请重试");
             return;
         }
         this.txtStatus.Text = "新建";
     }
     catch
     {
         this.PrintfError("重置过程出现异常,请重试");
         return;
     }
 }
Exemplo n.º 4
0
    protected void ImgNewButton_Click(object sender, ImageClickEventArgs e)
    {
        ChangeStatus();
        this.hidZT.Value = "Add";
        string CKDH = GetCKDJH();

        txtCKDH.Text = CKDH;
        txtZDR.Text  = CUSER.UserID;
        string strdate = DateTime.Now.ToShortDateString();

        txtZDRQ.Text = strdate;
        txtFYRQ.Text = strdate;
        this.drpFHCK.SelectedValue = "请选择";
        this.drpCYS.SelectedValue  = "请选择";
        this.drpCKLX.SelectedValue = "请选择";
        this.drpSHDW.SelectedValue = "请选择";
        this.txtCPH.Text           = "";
        this.txtMDD.Text           = "";
        this.txtNCDJ.Text          = "";
        this.txtStatus.Text        = "新建";
        try
        {
            DataSet ds = QTCKQuery.GetItemJieGou();
            Session["QTCKITEM"] = ds;
        }
        catch
        {
            this.PrintfError("新建时获得表结构出现错误,请重试");
            return;
        }
    }
Exemplo n.º 5
0
 protected void ImgQXWCbtn_Click(object sender, ImageClickEventArgs e)
 {
     try
     {
         string CKDH = this.txtCKDH.Text.Trim();
         string CK   = this.drpFHCK.SelectedValue;
         if (string.IsNullOrEmpty(CKDH))
         {
             this.PrintfError("请选择要重置的单据");
             return;
         }
         int status = QTCKQuery.GetStatus(CKDH);
         if (status < 2)
         {
             this.PrintfError("不用取消");
             return;
         }
         if (status == 2)
         {
             int result = QTCKQuery.QXWC(CKDH, CK, this.CUSER.UserID);
             if (result == 1)
             {
                 this.txtStatus.Text = "正在执行";
             }
         }
     }
     catch
     {
         this.PrintfError("取消完成过程出现错误,请重试");
         return;
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// 根据出库单号查询其它出库单概要及明细并赋值给Session,并给各个文本框赋值,并向子页面发送当前状态是浏览状态的信息,子页面会获得Session并绑定明细Grid
 /// </summary>
 private void InitAllByCKDH(string CKDH)
 {
     try
     {
         this.txtCKDH.Text = CKDH;
         DataSet ds = QTCKQuery.GetItem(CKDH);
         Session["QTCKITEM"] = ds;
         this.frameItem.Attributes["src"] = "QTCKD_item.aspx?ZT=Browse";
         if (ds != null && ds.Tables[1].Rows.Count > 0)
         {
             this.drpFHCK.SelectedValue = ds.Tables[1].Rows[0]["CK"].ToString();
             if (ds.Tables[1].Rows[0]["CPH"] != null)
             {
                 this.txtCPH.Text = ds.Tables[1].Rows[0]["CPH"].ToString();
             }
             if (ds.Tables[1].Rows[0]["AimAdress"] != null)
             {
                 this.txtMDD.Text = ds.Tables[1].Rows[0]["AimAdress"].ToString();
             }
             if (ds.Tables[1].Rows[0]["ZDR"] != null)
             {
                 this.txtZDR.Text = ds.Tables[1].Rows[0]["ZDR"].ToString();
             }
             if (ds.Tables[1].Rows[0]["ZDRQ"] != null)
             {
                 this.txtZDRQ.Text = ds.Tables[1].Rows[0]["ZDRQ"].ToString();
             }
             if (ds.Tables[1].Rows[0]["statusName"] != null)
             {
                 this.txtStatus.Text = ds.Tables[1].Rows[0]["statusName"].ToString();
             }
             if (ds.Tables[1].Rows[0]["CKLX"] != null)
             {
                 this.drpCKLX.Text = ds.Tables[1].Rows[0]["CKLX"].ToString();
             }
             if (ds.Tables[1].Rows[0]["NCDJ"] != null)
             {
                 this.txtNCDJ.Text = ds.Tables[1].Rows[0]["NCDJ"].ToString();
             }
             if (ds.Tables[1].Rows[0]["CYS"] != null)
             {
                 this.drpCYS.SelectedValue = ds.Tables[1].Rows[0]["CYS"].ToString();
             }
             if (ds.Tables[1].Rows[0]["FYSJ"] != null)
             {
                 this.txtFYRQ.Text = ds.Tables[1].Rows[0]["FYSJ"].ToString();
             }
             if (ds.Tables[1].Rows[0]["SHDW"] != null)
             {
                 this.drpSHDW.Text = ds.Tables[1].Rows[0]["SHDW"].ToString();
             }
         }
     }
     catch
     {
         this.PrintfError("查询后给父窗体赋值时出现错误,请重试");
         return;
     }
 }
Exemplo n.º 7
0
    /// <summary>
    /// 获得出库单据号
    /// </summary>
    /// <returns></returns>
    private string GetCKDJH()
    {
        string  str = "";
        DataSet ds  = QTCKQuery.execQCDH();

        if (ds != null)
        {
            string str1 = ds.Tables[0].Rows[0][0].ToString();
            string str2 = ds.Tables[0].Rows[0][1].ToString();
            str = "CK" + str1 + Convert.ToDouble(str2).ToString("000");
            return(str);
        }
        return(str);
    }
Exemplo n.º 8
0
 private void BindDJMX(string CKDH)
 {
     try
     {
         DataSet ds = QTCKQuery.GetPrintDJMX(CKDH);
         this.grvDJMX.DataSource = ds;
         this.grvDJMX.DataBind();
     }
     catch
     {
         this.PrintfError("数据访问错误");
         return;
     }
 }
Exemplo n.º 9
0
 protected void btnQuery_Click(object sender, ImageClickEventArgs e)
 {
     try
     {
         string  strWhere = GetStrWhere();
         DataSet ds       = QTCKQuery.GetPrintDS(strWhere);
         this.grvPrintCKDMX.DataSource = ds;
         this.grvPrintCKDMX.DataBind();
     }
     catch
     {
         this.PrintfError("查询出现错误");
         return;
     }
 }
Exemplo n.º 10
0
 //绑定gvdview
 private void BindgrvCKDMX()
 {
     try
     {
         string  sql   = GetQueryStr();
         DataSet liuds = QTCKQuery.QTCK_Query(sql);
         this.grvCKDMX.DataSource = liuds;
         this.grvCKDMX.DataBind();
     }
     catch
     {
         this.PrintfError("数据访问错误");
         return;
     }
 }
Exemplo n.º 11
0
 protected void ImgDeleteCKD_Click(object sender, ImageClickEventArgs e)
 {
     try
     {
         string CKDH = this.txtCKDH.Text.Trim();
         if (string.IsNullOrEmpty(CKDH))
         {
             this.PrintfError("请选择要修改的单据");
             return;
         }
         int status = QTCKQuery.GetStatus(CKDH);
         if (status > 0)
         {
             this.PrintfError("该单据已经执行,不能删除");
             return;
         }
         string result = QTCKQuery.DeleteCKD(CKDH);
         if (result != "success")
         {
             this.PrintfError("删除过程中发生异常");
             return;
         }
         txtCKDH.Text     = "";
         this.hidZT.Value = "";
         ReturnStatus();
         this.drpFHCK.SelectedIndex       = -1;
         this.txtCPH.Text                 = "";
         this.drpCKLX.Text                = "";
         this.txtNCDJ.Text                = "";
         this.txtFYRQ.Text                = "";
         this.txtMDD.Text                 = "";
         this.drpCYS.SelectedIndex        = -1;
         this.drpSHDW.Text                = "";
         this.txtStatus.Text              = "";
         this.txtZDR.Text                 = "";
         this.txtZDRQ.Text                = "";
         Session["QTCKITEM"]              = null;
         this.frameItem.Attributes["src"] = "QTCKD_item.aspx";
     }
     catch
     {
         this.PrintfError("删除过程出现错误,请重试");
         return;
     }
 }
Exemplo n.º 12
0
    //#region 批次号下拉列表改变时绑定属性下拉列表
    //protected void drpPCH_SelectedIndexChanged(object sender, EventArgs e)
    //{
    //    try
    //    {
    //        if (!string.IsNullOrEmpty(this.drpPCH.SelectedValue))
    //        {
    //            string CK = this.hidCK.Value.Trim();
    //            string PCH = this.drpPCH.SelectedValue;
    //            DataSet ds = QTCKQuery.GetSXbyPCH(PCH, CK);
    //            if (ds != null)
    //            {
    //                this.drpSX.DataSource = ds;
    //                this.drpSX.DataTextField = "SX";
    //                this.drpSX.ToolTip = "属性";
    //                this.drpSX.DataValueField = "SX";
    //                this.drpSX.DataBind();

    //                this.txtWLH.Text = ds.Tables[0].Rows[0]["WLH"].ToString();
    //                this.txtWLMC.Text = ds.Tables[0].Rows[0]["WLMC"].ToString();
    //                this.txtPH.Text = ds.Tables[0].Rows[0]["PH"].ToString();
    //                this.txtGG.Text = ds.Tables[0].Rows[0]["GG"].ToString();
    //            }
    //        }
    //    }
    //    catch
    //    {
    //        this.PrintfError("数据访问错误");
    //        return;
    //    }
    //}
    //#endregion

    #region 属性下拉列表改变时给规格等几个文本框赋值
    protected void drpSX_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            if (!string.IsNullOrEmpty(this.drpSX.SelectedValue))
            {
                string CK = this.hidCK.Value.Trim();
                //string PCH = this.drpPCH.SelectedValue;
                string  PCH = this.txtPCH.Text.Trim();
                string  SX  = this.drpSX.SelectedValue;
                DataSet ds  = QTCKQuery.GetWLHbySX(SX, PCH, CK);
                if (ds != null)
                {
                    this.drpFree1.DataSource     = ds;
                    this.drpFree1.DataTextField  = "vfree1";
                    this.drpFree1.ToolTip        = "自由项1";
                    this.drpFree1.DataValueField = "vfree1";
                    this.drpFree1.DataBind();

                    this.drpFree2.DataSource     = ds;
                    this.drpFree2.DataTextField  = "vfree2";
                    this.drpFree2.ToolTip        = "自由项2";
                    this.drpFree2.DataValueField = "vfree2";
                    this.drpFree2.DataBind();

                    this.drpFree3.DataSource     = ds;
                    this.drpFree3.DataTextField  = "vfree3";
                    this.drpFree3.ToolTip        = "自由项3";
                    this.drpFree3.DataValueField = "vfree3";
                    this.drpFree3.DataBind();

                    this.txtWLH.Text  = ds.Tables[0].Rows[0]["WLH"].ToString();
                    this.txtWLMC.Text = ds.Tables[0].Rows[0]["WLMC"].ToString();
                    this.txtPH.Text   = ds.Tables[0].Rows[0]["PH"].ToString();
                    this.txtGG.Text   = ds.Tables[0].Rows[0]["GG"].ToString();
                }
            }
        }
        catch
        {
            this.PrintfError("数据访问错误");
            return;
        }
    }
Exemplo n.º 13
0
 private void BinddrpSHDW()
 {
     try
     {
         DataSet ds3 = QTCKQuery.GetCHE_QTCK("shdw", "shdw");
         if (ds3 != null)
         {
             this.drpSHDW.DataSource     = ds3;
             this.drpSHDW.DataTextField  = "shdw";
             this.drpSHDW.DataValueField = "shdw";
             this.drpSHDW.DataBind();
         }
         this.drpSHDW.Items.Insert(0, "请选择");
     }
     catch
     {
         this.PrintfError("数据访问错误");
         return;
     }
 }
Exemplo n.º 14
0
 private void BinddrpZDR()
 {
     try
     {
         DataSet ds = QTCKQuery.GetCHE_QTCK("ZDR", "");
         if (ds != null)
         {
             this.drpZDR.DataSource     = ds;
             this.drpZDR.DataTextField  = "ZDR";
             this.drpZDR.DataValueField = "ZDR";
             this.drpZDR.DataBind();
         }
         this.drpZDR.Items.Insert(0, "请选择");
     }
     catch
     {
         this.PrintfError("访问数据出错!");
         return;
     }
 }
Exemplo n.º 15
0
 private void BinddrpCYS()
 {
     try
     {
         DataSet ds2 = QTCKQuery.GetCHE_QTCK("cys", "cys");
         if (ds2 != null)
         {
             this.drpCYS.DataSource     = ds2;
             this.drpCYS.DataTextField  = "cys";
             this.drpCYS.DataValueField = "cys";
             this.drpCYS.DataBind();
         }
         this.drpCYS.Items.Insert(0, "请选择");
     }
     catch
     {
         this.PrintfError("访问数据出错");
         return;
     }
 }
Exemplo n.º 16
0
 private void BinddrpCK()
 {
     try
     {
         DataSet ds = QTCKQuery.GetCKID();
         if (ds != null)
         {
             this.drpCK.DataSource     = ds;
             this.drpCK.DataTextField  = "CKID";
             this.drpCK.ToolTip        = "请选择仓库类型";
             this.drpCK.DataValueField = "CKID";
             this.drpCK.DataBind();
         }
         this.drpCK.Items.Insert(0, "请选择");
     }
     catch
     {
         this.PrintfError("访问数据出错!");
         return;
     }
 }
Exemplo n.º 17
0
 /// <summary>
 /// 页面加载时收货单位
 /// </summary>
 private void BinddrpSHDW()
 {
     try
     {
         DataSet ds3 = QTCKQuery.GetCHE_QTCK("shdw", "shdw");
         if (ds3 != null)
         {
             this.drpSHDW.DataSource     = ds3;
             this.drpSHDW.DataTextField  = "shdw";
             this.drpSHDW.DataValueField = "shdw";
             this.drpSHDW.DataBind();
             Bestcomy.Web.UI.WebControls.ComboItem value = new Bestcomy.Web.UI.WebControls.ComboItem("请选择");
             this.drpSHDW.Items.Insert(0, value);
         }
     }
     catch
     {
         this.PrintfError("加载收货单位时出错");
         return;
     }
 }
Exemplo n.º 18
0
 private void BinddrpCKLX()
 {
     try
     {
         DataSet ds = QTCKQuery.GetCHE_QTCK("cklx", "");
         if (ds != null)
         {
             this.drpCKLX.DataSource     = ds;
             this.drpCKLX.DataTextField  = "cklx";
             this.drpCKLX.ToolTip        = "请选择出库类型";
             this.drpCKLX.DataValueField = "cklx";
             this.drpCKLX.DataBind();
         }
         this.drpCKLX.Items.Insert(0, "请选择");
     }
     catch
     {
         this.PrintfError("访问数据出错!");
         return;
     }
 }
Exemplo n.º 19
0
 private void BinddrpNCDJ()
 {
     try
     {
         DataSet ds = QTCKQuery.GetCHE_QTCK("ncdj", "");
         if (ds != null)
         {
             this.drpNCDJ.DataSource     = ds;
             this.drpNCDJ.DataTextField  = "ncdj";
             this.drpNCDJ.DataValueField = "ncdj";
             this.drpNCDJ.DataBind();
         }
         Bestcomy.Web.UI.WebControls.ComboItem value = new Bestcomy.Web.UI.WebControls.ComboItem("请选择");
         this.drpNCDJ.Items.Insert(0, value);
     }
     catch
     {
         this.PrintfError("访问数据出错!");
         return;
     }
 }
Exemplo n.º 20
0
 /// <summary>
 /// 页面加载时绑定出库类型
 /// </summary>
 private void BinddrpCKLX()
 {
     try
     {
         DataSet ds1 = QTCKQuery.GetCHE_QTCK("cklx", "");
         if (ds1 != null)
         {
             this.drpCKLX.DataSource     = ds1;
             this.drpCKLX.DataTextField  = "cklx";
             this.drpCKLX.DataValueField = "cklx";
             this.drpCKLX.DataBind();
             Bestcomy.Web.UI.WebControls.ComboItem value = new Bestcomy.Web.UI.WebControls.ComboItem("请选择");
             this.drpCKLX.Items.Insert(0, value);
         }
     }
     catch
     {
         this.PrintfError("加载出库类型时出错");
         return;
     }
 }
Exemplo n.º 21
0
    /// <summary>
    /// 绑定属性及自由项下拉列表
    /// </summary>
    /// <param name="PCH"></param>
    /// <param name="CK"></param>
    private void BindSX(string PCH, string CK)
    {
        try
        {
            DataSet ds = QTCKQuery.GetSXbyPCH(PCH, CK);
            if (ds != null)
            {
                this.drpSX.DataSource     = ds;
                this.drpSX.DataTextField  = "SX";
                this.drpSX.ToolTip        = "属性";
                this.drpSX.DataValueField = "SX";
                this.drpSX.DataBind();

                this.drpFree1.DataSource     = ds;
                this.drpFree1.DataTextField  = "Vfree1";
                this.drpFree1.ToolTip        = "自由项1";
                this.drpFree1.DataValueField = "Vfree1";
                this.drpFree1.DataBind();

                this.drpFree2.DataSource     = ds;
                this.drpFree2.DataTextField  = "Vfree2";
                this.drpFree2.ToolTip        = "自由项2";
                this.drpFree2.DataValueField = "Vfree2";
                this.drpFree2.DataBind();

                this.drpFree3.DataSource     = ds;
                this.drpFree3.DataTextField  = "Vfree3";
                this.drpFree3.ToolTip        = "自由项3";
                this.drpFree3.DataValueField = "Vfree3";
                this.drpFree3.DataBind();
            }
        }
        catch
        {
            this.PrintfError("数据访问错误");
            return;
        }
    }
Exemplo n.º 22
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         BinddrpCK();
         BinddrpCKLX();
         BinddrpNCDJ();
         BinddrpCYS();
         BinddrpZDR();
         BinddrpSHDW();
         string strdate = DateTime.Now.ToShortDateString();
         txtZDRQ1.Text      = strdate;
         txtZDRQ2.Text      = strdate;
         this.hidCKDH.Value = Request["CKDH"];
         if (!string.IsNullOrEmpty(this.hidCKDH.Value))
         {
             string  CKDH = this.hidCKDH.Value.Trim();
             DataSet ds   = QTCKQuery.GetPrintDS("and CKDH = '" + CKDH + "'");
             this.grvPrintCKDMX.DataSource = ds;
             this.grvPrintCKDMX.DataBind();
             this.frameItem.Attributes["src"] = "PrintQTCKItem.aspx?CKDH=" + CKDH;
         }
     }
 }
Exemplo n.º 23
0
    protected void imgSave_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            if (!CheckInfo())
            {
                return;
            }
            int i = QTCKQuery.GetRecordCount(this.txtCKDH.Text);
            if (i > 0)
            {
                this.PrintfError("该单据已经执行,不能修改");
                return;
            }
            string DJZT = this.hidZT.Value.Trim();
            if (DJZT == "Add")//保存新建的单据
            {
                DataSet ds = (DataSet)Session["QTCKITEM"];
                if (ds == null || ds.Tables[0].Rows.Count < 1)
                {
                    this.PrintfError("未添加任何明细,请进行添加!");
                    return;
                }
                string  CKDH = this.txtCKDH.Text.Trim();
                string  CK   = this.drpFHCK.SelectedValue;
                string  CPH  = this.txtCPH.Text.Trim();
                string  MDD  = this.txtMDD.Text.Trim();
                string  ZDR  = this.txtZDR.Text.Trim();
                string  ZDRQ = this.txtZDRQ.Text.Trim();
                string  CKLX = this.drpCKLX.Text.Trim();
                string  NCDJ = this.txtNCDJ.Text.Trim();
                string  CYS  = this.drpCYS.SelectedValue;
                string  FYSJ = this.txtFYRQ.Text.Trim();
                string  SHDW = this.drpSHDW.Text.Trim();
                DataRow row  = ds.Tables[1].NewRow();//CKDH,CK,CKLX,NCDJ
                row["CKDH"]      = CKDH;
                row["CK"]        = CK;
                row["CPH"]       = CPH;
                row["AimAdress"] = MDD;
                row["ZDR"]       = ZDR;
                row["ZDRQ"]      = DateTime.Now;
                row["STATUS"]    = "0";
                row["CKLX"]      = CKLX;
                row["NCDJ"]      = NCDJ;
                if (CYS != "请选择")
                {
                    row["CYS"] = CYS;
                }
                row["FYSJ"] = Convert.ToDateTime(FYSJ);
                if (SHDW != "请选择" || !string.IsNullOrEmpty(SHDW))
                {
                    row["SHDW"] = SHDW;
                }
                ds.Tables[1].Rows.Add(row);

                QTCKQuery.AddQTCKD(ds);
                this.hidZT.Value = "";
                ReturnStatus();
            }
            if (DJZT == "Modify")//保存修改的单据
            {
                DataSet ds = (DataSet)Session["QTCKITEM"];
                if (ds == null || ds.Tables[0].Rows.Count < 1)
                {
                    this.PrintfError("未添加任何明细,请进行添加!");
                    return;
                }
                string CKDH = this.txtCKDH.Text.Trim();
                string CK   = this.drpFHCK.SelectedValue;
                string CPH  = this.txtCPH.Text.Trim();
                string MDD  = this.txtMDD.Text.Trim();
                string ZDR  = this.txtZDR.Text.Trim();
                string ZDRQ = this.txtZDRQ.Text.Trim();
                string CKLX = this.drpCKLX.Text.Trim();
                string NCDJ = this.txtNCDJ.Text.Trim();
                string CYS  = this.drpCYS.SelectedValue;
                string FYSJ = this.txtFYRQ.Text.Trim();
                string SHDW = this.drpSHDW.Text.Trim();
                ds.Tables[1].Rows[0]["CK"]        = CK;
                ds.Tables[1].Rows[0]["CPH"]       = CPH;
                ds.Tables[1].Rows[0]["AimAdress"] = MDD;
                ds.Tables[1].Rows[0]["ZDR"]       = ZDR;
                ds.Tables[1].Rows[0]["ZDRQ"]      = ZDRQ;
                ds.Tables[1].Rows[0]["CKLX"]      = CKLX;
                ds.Tables[1].Rows[0]["NCDJ"]      = NCDJ;
                ds.Tables[1].Rows[0]["CYS"]       = CYS;
                ds.Tables[1].Rows[0]["FYSJ"]      = FYSJ;
                ds.Tables[1].Rows[0]["SHDW"]      = SHDW;

                QTCKQuery.AddQTCKD(ds);
                this.hidZT.Value = "";
                ReturnStatus();
            }
            this.frameItem.Attributes["src"] = "QTCKD_item.aspx?ZT=Browse";
        }
        catch
        {
            this.PrintfError("保存过程出现错误,请重试");
            return;
        }
    }
Exemplo n.º 24
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string action = Request.QueryString["action"];

        switch (action)
        {
        case "deldj":
            string  delckdh = Request.QueryString["ckdh"];
            DataSet ds3     = QTCKQuery.GetQTCKstatus("ckdh", delckdh);
            if (ds3 != null)
            {
                if (ds3.Tables[0].Rows.Count > 0)
                {
                    Response.Write("NotDel");
                    //this.PrintfError("该单据已经执行,不能删除");
                    return;
                }
            }
            Response.Write("false");
            //Response.Write("<script>if (!confirm('确实要删除此出库单吗?')) return false;</script>");

            break;

        case "zaideldj":
            string    zaicdelkdh = Request.QueryString["ckdh"];
            QTCKQuery delqtck    = new QTCKQuery();
            delqtck.CKDHDel(zaicdelkdh);
            break;

        case "ChongZhi":
            string  chongzhickdh = Request.QueryString["ckdh"];
            DataSet ds4          = QTCKQuery.GetQTCKstatus("ckdh", chongzhickdh);
            if (ds4 != null)
            {
                if (ds4.Tables[0].Rows.Count >= 1)
                {
                    //this.PrintfError("该单据已经执行完成,不能重置");
                    Response.Write("NotChongZhi");
                    return;
                }
                if (ds4.Tables[0].Rows.Count == 0)
                {
                    //this.PrintfError("不用重置");
                    Response.Write("NoYong");
                    return;
                }
                Response.Write("false");
            }
            break;

        case "ZaiChongZhi":
            string    zaickdh = Request.QueryString["ckdh"];
            QTCKQuery czqtck  = new QTCKQuery();
            czqtck.CKDHChongZhi(zaickdh);
            czqtck.ChongZhiStatus(zaickdh);
            Response.Write("new");
            break;

        case "CancelDJ":
            string cancelckdh = Request.QueryString["ckdh"];
            int    i          = QTCKQuery.GetRecordCount(cancelckdh);
            if (i < 2)
            {
                //this.PrintfError("不用取消");
                Response.Write("NoCancel");
                return;
            }
            if (i == 2)
            {
                Response.Write("false");
            }
            break;

        case "zaiCancelDJ":
            string zaiCancelckdh = Request.QueryString["ckdh"];
            string fhck          = Request.QueryString["fhck"];
            int    j             = QTCKQuery.Exec_cancelqtck(zaiCancelckdh, fhck, CUSER.UserID);
            if (j == 1)
            {
                Response.Write("zhixing");        //正在执行
            }
            else
            {
                Response.Write("wrong");        //取消完成失败!
            }
            break;

        case "SaveDJ":
            string saveckdh  = Request.QueryString["ckdh"];
            string Current   = Request.QueryString["Current"];
            string status    = Request.QueryString["status"];
            string ck        = Request.QueryString["ck"];
            string ncdj      = Request.QueryString["ncdj"];
            string cph       = Request.QueryString["cph"];
            string txtTARGET = Request.QueryString["txtTARGET"];
            string CYS       = Request.QueryString["CYS"];
            string SHDW      = Request.QueryString["SHDW"];
            string ZDR       = Request.QueryString["ZDR"];
            string ZDRQ      = Request.QueryString["ZDRQ"];
            int    k         = QTCKQuery.GetRecordCount(saveckdh);
            if (k > 0)
            {
                Response.Write("NoMODI");
                //this.PrintfError("该单据已经执行,不能修改");
                return;
            }

            if (Current == "new")
            {
            }
            break;

        case "ModiMX":
            string  MXckdh = Request.QueryString["ckdh"];
            DataSet dsmx   = QTCKQuery.GetQTCKitem("ckdh", MXckdh);
            if (dsmx == null)
            {
                Response.Write("wrongmx");
            }
            break;

        case "DelMX":
            string  delmxckdh = Request.QueryString["ckdh"];
            DataSet deldsmx   = QTCKQuery.GetQTCKitem("ckdh", delmxckdh);
            if (deldsmx == null)
            {
                Response.Write("Delmx");
            }
            break;

        case "zaiDelMX":
            string    zaidelmx = Request.QueryString["ckdh"];
            QTCKQuery dsdel    = new QTCKQuery();
            dsdel.CKDHDel(zaidelmx);
            Response.Write("success");
            break;

        case "add":
            string strFCKDH = Request.QueryString["fckdh"];
            string strFCK   = Request.QueryString["fhck"];
            string strPCH   = Request.QueryString["pch"];
            string strSX    = Request.QueryString["sx"];

            string    strWLH    = Request.QueryString["wlh"];
            string    strWLMC   = Request.QueryString["wlmc"];
            string    strPH     = Request.QueryString["ph"];
            string    strGG     = Request.QueryString["gg"];
            string    strSLDW   = Request.QueryString["sldw"];
            string    strZLDW   = Request.QueryString["zldw"];
            string    strJHSL   = Request.QueryString["jhsl"];
            string    strJHZL   = Request.QueryString["jhzl"];
            QTCKQuery qtckquery = new QTCKQuery();
            qtckquery.Add(strFCKDH, strPCH, strSX, strWLH, strWLMC, strPH, strGG, strJHSL, strJHZL, 0, 0, strSLDW, strZLDW);
            Response.Write("ins_suss");
            break;
        }
    }
Exemplo n.º 25
0
    private string GetQueryStr()
    {
        string Querystr = "";

        if (!string.IsNullOrEmpty(txtCKDH.Text))
        {
            Querystr += " and ckdh like '%" + txtCKDH.Text + "%'";
        }
        if (!string.IsNullOrEmpty(txtCPH.Text))
        {
            Querystr += " and cph like '%" + txtCPH.Text + "%'";
        }
        if (drpMDD.SelectedValue != "请选择" && !string.IsNullOrEmpty(drpMDD.SelectedValue))
        {
            Querystr += " and AimAdress like '%" + drpMDD.SelectedValue.ToString() + "%'";
        }
        if (drpCK.SelectedValue != "请选择" && !string.IsNullOrEmpty(drpCK.SelectedValue))
        {
            Querystr += " and ck='" + drpCK.SelectedValue.ToString() + "'";
        }
        if (drpStatus.SelectedValue != "请选择" && !string.IsNullOrEmpty(drpStatus.SelectedValue))
        {
            Querystr += " and STATUS=" + drpStatus.SelectedValue.ToString();
        }
        if (drpZDR.SelectedValue != "请选择" && !string.IsNullOrEmpty(drpZDR.SelectedValue))
        {
            Querystr += " and zdr='" + drpZDR.SelectedValue.ToString() + "'";
        }
        if (drpCKLX.SelectedValue != "请选择" && !string.IsNullOrEmpty(drpCKLX.SelectedValue))
        {
            Querystr += " and cklx='" + drpCKLX.SelectedValue.ToString() + "'";
        }
        if (drpNCDJ.SelectedValue != "请选择" && !string.IsNullOrEmpty(drpNCDJ.SelectedValue))
        {
            Querystr += " and NCDJ='" + drpNCDJ.SelectedValue.ToString() + "'";
        }
        if (!string.IsNullOrEmpty(this.hidZDRQ.Value))
        {
            string ZDRQ1 = txtZDRQ1.Text + " 00:00:00";
            string ZDRQ2 = txtZDRQ2.Text + " 23:59:59";
            Querystr += " and (zdrq>='" + ZDRQ1 + "' and zdrq<='" + ZDRQ2 + "')";
        }
        if (drpPCH.SelectedValue != "请选择")
        {
            string  strpch = "";
            DataSet ds     = QTCKQuery.GetCHE_QTCKPCH("ckdh", "pch", this.drpPCH.SelectedValue);

            if (ds != null)
            {
                int i = 0;
                while (i < ds.Tables[0].Rows.Count)
                {
                    strpch += ds.Tables[0].Rows[i][0].ToString() + ",";
                    i++;
                }
                strpch = strpch.Remove(strpch.Length - 1, 1);
                if (ds.Tables[0].Rows.Count >= 1)
                {
                    Querystr += " and ckdh in('" + strpch + "')";
                }
            }
        }
        return(Querystr);
    }
Exemplo n.º 26
0
    protected void txtPCH_TextChanged(object sender, EventArgs e)
    {
        try
        {
            string CK  = this.hidCK.Value.Trim();
            string PCH = this.txtPCH.Text.Trim();
            if (!string.IsNullOrEmpty(PCH))
            {
                DataSet ds   = QTCKQuery.GetSXbyPCH(PCH, CK);
                DataSet dsSX = QTCKQuery.GetSXbyPCHNEW(PCH, CK);
                if (dsSX != null && dsSX.Tables[0].Rows.Count > 0)
                {
                    this.drpSX.DataSource     = dsSX;
                    this.drpSX.DataTextField  = "SX";
                    this.drpSX.ToolTip        = "属性";
                    this.drpSX.DataValueField = "SX";
                    this.drpSX.DataBind();

                    DataSet dsFree1 = QTCKQuery.GetFree1BySX(this.drpSX.SelectedValue, PCH, CK);
                    this.drpFree1.DataSource     = dsFree1;
                    this.drpFree1.DataTextField  = "vfree1";
                    this.drpFree1.ToolTip        = "自由项1";
                    this.drpFree1.DataValueField = "vfree1";
                    this.drpFree1.DataBind();

                    DataSet dsFree2 = QTCKQuery.GetFree2BySX(this.drpSX.SelectedValue, PCH, CK);
                    this.drpFree2.DataSource     = dsFree2;
                    this.drpFree2.DataTextField  = "vfree2";
                    this.drpFree2.ToolTip        = "自由项2";
                    this.drpFree2.DataValueField = "vfree2";
                    this.drpFree2.DataBind();

                    DataSet dsFree3 = QTCKQuery.GetFree3BySX(this.drpSX.SelectedValue, PCH, CK);
                    this.drpFree3.DataSource     = dsFree3;
                    this.drpFree3.DataTextField  = "vfree3";
                    this.drpFree3.ToolTip        = "自由项3";
                    this.drpFree3.DataValueField = "vfree3";
                    this.drpFree3.DataBind();


                    this.txtWLH.Text  = ds.Tables[0].Rows[0]["WLH"].ToString();
                    this.txtWLMC.Text = ds.Tables[0].Rows[0]["WLMC"].ToString();
                    this.txtPH.Text   = ds.Tables[0].Rows[0]["PH"].ToString();
                    this.txtGG.Text   = ds.Tables[0].Rows[0]["GG"].ToString();
                }
                else
                {
                    this.drpSX.Items.Clear();
                    this.drpFree1.Items.Clear();
                    this.drpFree2.Items.Clear();
                    this.drpFree3.Items.Clear();

                    this.txtWLH.Text  = "";
                    this.txtWLMC.Text = "";
                    this.txtPH.Text   = "";
                    this.txtGG.Text   = "";
                    this.txtJHSL.Text = "";
                    this.txtJHZL.Text = "";
                }
            }
        }
        catch (Exception ex)
        {
            this.PrintfError(ex.Message);
            return;
        }
    }
Exemplo n.º 27
0
    //设置报表
    private void SetReport()
    {
        this.ReportView1.ServerUrl = this.ReportURL;

        string Type    = Request["TYPE"];
        string hidCKDH = Request["hidCKDH"];

        switch (Type)
        {
        case "0":
            if (Common.IsOldData)
            {
                this.ReportView1.ReportPath = "/XGReportO/ReportQTCK";
            }
            else
            {
                this.ReportView1.ReportPath = "/XGReportC/ReportQTCK";
            }
            break;

        case "1":
            if (Common.IsOldData)
            {
                this.ReportView1.ReportPath = "/XGReportO/ReportQTCKDJHJ";
            }
            else
            {
                this.ReportView1.ReportPath = "/XGReportC/ReportQTCKDJHJ";
            }
            break;

        case "2":
            if (Common.IsOldData)
            {
                this.ReportView1.ReportPath = "/XGReportO/ReportQTCKHJ";
            }
            else
            {
                this.ReportView1.ReportPath = "/XGReportC/ReportQTCKHJ";
            }
            break;
        }
        ReportView1.Parameters = Acctrue.WM_WES.ReportingServices.ReportView.multiState.False;
        ReportView1.DocMap     = Acctrue.WM_WES.ReportingServices.ReportView.multiState.False;
        ReportView1.Toolbar    = Acctrue.WM_WES.ReportingServices.ReportView.multiState.True;

        switch (Type)
        {
        case "0":
            DataSet ds = QTCKQuery.GetPrintDS("and CKDH='" + hidCKDH + "'");
            if (!string.IsNullOrEmpty(hidCKDH))
            {
                ReportView1.SetParameter("CKDH", hidCKDH);
            }
            if (ds.Tables[0].Rows[0]["CPH"] != null)
            {
                ReportView1.SetParameter("CPH", Server.UrlEncode(ds.Tables[0].Rows[0]["CPH"].ToString()));
            }
            if (ds.Tables[0].Rows[0]["SHDW"] != null)
            {
                ReportView1.SetParameter("SHDW", Server.UrlEncode(ds.Tables[0].Rows[0]["SHDW"].ToString()));
            }
            if (ds.Tables[0].Rows[0]["ZDR"] != null)
            {
                ReportView1.SetParameter("ZDR", Server.UrlEncode(ds.Tables[0].Rows[0]["ZDR"].ToString()));
            }
            if (ds.Tables[0].Rows[0]["FYSJ"] != null)
            {
                ReportView1.SetParameter("FYRQ", ds.Tables[0].Rows[0]["FYSJ"].ToString());
            }
            if (ds.Tables[0].Rows[0]["NCDJ"] != null)
            {
                ReportView1.SetParameter("NCDJ", ds.Tables[0].Rows[0]["NCDJ"].ToString());
            }
            if (ds.Tables[0].Rows[0]["CYS"] != null)
            {
                ReportView1.SetParameter("CYS", Server.UrlEncode(ds.Tables[0].Rows[0]["CYS"].ToString()));
            }
            if (ds.Tables[0].Rows[0]["AimAdress"] != null)
            {
                ReportView1.SetParameter("MDD", Server.UrlEncode(ds.Tables[0].Rows[0]["AimAdress"].ToString()));
            }
            if (ds.Tables[0].Rows[0]["ZDRQ"] != null)
            {
                ReportView1.SetParameter("ZDRQ", ds.Tables[0].Rows[0]["ZDRQ"].ToString());
            }
            if (ds.Tables[0].Rows[0]["CK"] != null)
            {
                ReportView1.SetParameter("CK", ds.Tables[0].Rows[0]["CK"].ToString());
            }
            if (ds.Tables[0].Rows[0]["CKLX"] != null)
            {
                ReportView1.SetParameter("CKLX", Server.UrlEncode(ds.Tables[0].Rows[0]["CKLX"].ToString()));
            }
            break;

        case "1":
            if (!string.IsNullOrEmpty(Request["CKDH"]))
            {
                ReportView1.SetParameter("CKDH", Request["CKDH"]);
            }
            if (!string.IsNullOrEmpty(Request["CPH"]))
            {
                ReportView1.SetParameter("CPH", Request["CPH"]);
            }
            if (!string.IsNullOrEmpty(Request["ncdj"]))
            {
                ReportView1.SetParameter("ncdj", Request["ncdj"]);
            }
            if (!string.IsNullOrEmpty(Request["CKLX"]))
            {
                ReportView1.SetParameter("CKLX", Request["CKLX"]);
            }
            if (!string.IsNullOrEmpty(Request["CYS"]))
            {
                ReportView1.SetParameter("CYS", Request["CYS"]);
            }
            if (!string.IsNullOrEmpty(Request["CK"]))
            {
                ReportView1.SetParameter("CK", Request["CK"]);
            }
            if (!string.IsNullOrEmpty(Request["status"]))
            {
                ReportView1.SetParameter("status", Request["status"]);
            }
            if (!string.IsNullOrEmpty(Request["ZDR"]))
            {
                ReportView1.SetParameter("ZDR", Request["ZDR"]);
            }
            if (!string.IsNullOrEmpty(Request["SHDW"]))
            {
                ReportView1.SetParameter("SHDW", Request["SHDW"]);
            }
            if (!string.IsNullOrEmpty(Request["ZDRQfrom"]))
            {
                ReportView1.SetParameter("ZDRQfrom", Request["ZDRQfrom"]);
            }
            if (!string.IsNullOrEmpty(Request["ZDRQto"]))
            {
                ReportView1.SetParameter("ZDRQto", Request["ZDRQto"]);
            }
            break;

        case "2":
            if (!string.IsNullOrEmpty(Request["CKDH"]))
            {
                ReportView1.SetParameter("CKDH", Request["CKDH"]);
            }
            if (!string.IsNullOrEmpty(Request["CPH"]))
            {
                ReportView1.SetParameter("CPH", Request["CPH"]);
            }
            if (!string.IsNullOrEmpty(Request["ncdj"]))
            {
                ReportView1.SetParameter("ncdj", Request["ncdj"]);
            }
            if (!string.IsNullOrEmpty(Request["CKLX"]))
            {
                ReportView1.SetParameter("CKLX", Request["CKLX"]);
            }
            if (!string.IsNullOrEmpty(Request["CYS"]))
            {
                ReportView1.SetParameter("CYS", Request["CYS"]);
            }
            if (!string.IsNullOrEmpty(Request["CK"]))
            {
                ReportView1.SetParameter("CK", Request["CK"]);
            }
            if (!string.IsNullOrEmpty(Request["status"]))
            {
                ReportView1.SetParameter("status", Request["status"]);
            }
            if (!string.IsNullOrEmpty(Request["ZDR"]))
            {
                ReportView1.SetParameter("ZDR", Request["ZDR"]);
            }
            if (!string.IsNullOrEmpty(Request["SHDW"]))
            {
                ReportView1.SetParameter("SHDW", Request["SHDW"]);
            }
            if (!string.IsNullOrEmpty(Request["ZDRQfrom"]))
            {
                ReportView1.SetParameter("ZDRQfrom", Request["ZDRQfrom"]);
            }
            if (!string.IsNullOrEmpty(Request["ZDRQto"]))
            {
                ReportView1.SetParameter("ZDRQto", Request["ZDRQto"]);
            }
            break;
        }
    }