Ejemplo n.º 1
0
//		private void DataGrid1_CancelCommand(object source, DataGridCommandEventArgs e)
//		{
//			this.DataGrid1.EditItemIndex=-1;
//			this.DataGrid1.DataSource=(DataTable)Session["QUERY"];
//			this.DataGrid1.DataBind();
//		}
//
//		private void DataGrid1_EditCommand(object source, DataGridCommandEventArgs e)
//		{
//			this.DataGrid1.EditItemIndex=e.Item.ItemIndex;
//			this.DataGrid1.DataSource=(DataTable)Session["QUERY"];
//			this.DataGrid1.DataBind();
//		}
//
//		private void DataGrid1_UpdateCommand(object source, DataGridCommandEventArgs e)
//		{
//			DataTable dttmp=(DataTable)Session["QUERY"];
//			Session.Remove("QUERY");
//			double SystemCount=Math.Round(double.Parse(e.Item.Cells[13].Text),2);
//			double RealCount=Math.Round(double.Parse(((TextBox)e.Item.Cells[14].Controls[0]).Text.Trim()),2);
//
//			dttmp.Rows[e.Item.ItemIndex]["cnnRealCount"]=RealCount.ToString();
//			dttmp.Rows[e.Item.ItemIndex]["cnnDifferentCount"]=(SystemCount-RealCount).ToString();
//			Session["QUERY"]=dttmp;
//			this.DataGrid1.EditItemIndex=-1;
//			this.DataGrid1.DataSource=(DataTable)Session["QUERY"];
//			this.DataGrid1.DataBind();
//		}

        private void btnCheckOk_Click(object sender, System.EventArgs e)
        {
            if (this.Textbox2.Text.Trim() == "")
            {
                this.SetErrorMsgPageBydirHistory("Å̵ãÈ˲»ÄÜΪ¿Õ£¡");
                return;
            }

            string strDeptID      = this.ddlDept.SelectedValue;
            string strDate        = DateTime.Now.ToShortDateString();
            string strWeather     = this.Textbox1.Text.Trim();
            string strCheckOper   = this.Textbox2.Text.Trim();
            string strManager     = this.Textbox3.Text.Trim();
            string strProductType = this.ddlProductType.SelectedValue;

            CMSMStruct.LoginStruct ls1 = (CMSMStruct.LoginStruct)Session["Login"];
            string strOperDate         = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString();

            Hashtable htPara = new Hashtable();

            htPara.Add("strDeptID", strDeptID);
            htPara.Add("strDate", strDate);
            htPara.Add("strWeather", strWeather);
            htPara.Add("strCheckOper", strCheckOper);
            htPara.Add("strManager", strManager);
            htPara.Add("strOperName", ls1.strOperName);
            htPara.Add("strOperDate", strOperDate);
            htPara.Add("strProductType", strProductType);

            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                if (StoBusi.DayCheckFinal(htPara, (DataTable)Session["QUERY"]))
                {
                    this.DataGrid1.Columns[14].Visible = true;
                    this.DataGrid1.Columns[15].Visible = false;
                    this.btnCheckOk.Enabled            = false;
                    this.btnEdit.Enabled = false;
                    this.btnEdit.Text    = "±à¼­";
                    this.SetSuccMsgPageBydir("Å̵ã³É¹¦£¡", "Storage/wfmSaleDailyCheck.aspx");
                    return;
                }
                else
                {
                    this.SetErrorMsgPageBydir("Å̵ãʱ·¢Éú´íÎó£¬ÇëÖØÊÔ£¡");
                    return;
                }
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("²éѯ´íÎó£¬ÇëÖØÊÔ£¡");
                return;
            }
        }