//进度表的编辑、删除 //protected void Gridview2_RowCommand(object sender, GridViewCommandEventArgs e) //{ // if (e.CommandName == "Modify")//编辑 // { // GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; // Gridview2.SelectedIndex = row.RowIndex; // this.label_ProgramID.Text = e.CommandArgument.ToString(); // this.label9.Visible = true; // this.DropDownList1.SelectedValue = this.Gridview2.Rows[row.RowIndex].Cells[1].Text.ToString(); // this.TextBox10.Text = this.Gridview2.Rows[row.RowIndex].Cells[2].Text.ToString(); // this.Panel_NewProgram.Visible = true; // this.UpdatePanel_NewProgram.Update(); // } //} //提交开发进度 protected void Button_Rocky(object sender, EventArgs e) { if (DropDownList1.SelectedValue != "请选择") { CRMNewCustormDevelopinfo.CRMNCD_DevelopState = DropDownList1.SelectedValue.ToString(); } else { ScriptManager.RegisterClientScriptBlock(UpdatePanel_NewProgram, GetType(), "aa", "alert('标记*的为必填项,请填写完整!')", true); return; } if (TextBox10.Text != "") { CRMNewCustormDevelopinfo.CRMNCD_DetailCondition = TextBox10.Text; } else { ScriptManager.RegisterClientScriptBlock(UpdatePanel_NewProgram, GetType(), "aa", "alert('标记*的为必填项,请填写完整!')", true); return; } CRMNewCustormDevelopinfo.CRMNCD_ID = new Guid(label_ManID.Text.ToString()); ccl.UpdateCRMNewCustormDevelop_Schedule(CRMNewCustormDevelopinfo); TextBox10.Text = ""; DropDownList1.SelectedValue = "请选择"; Panel_NewProgram.Visible = false; UpdatePanel_NewProgram.Update(); BindGridview1(""); UpdatePanel_OutWeb.Update(); }
protected void Check_NOK(object sender, EventArgs e) { if (TextBox9.Text == "") { ScriptManager.RegisterClientScriptBlock(Page, GetType(), "alert", "alert('驳回时必须填写审核意见')", true); return; } string note = TextBox9.Text.ToString(); string man = Session["UserName"].ToString(); string state = "审核驳回"; string bos = DropDownList2.SelectedValue.ToString(); Guid id = new Guid(label19.Text.ToString()); cs.UpdateCRMOutsideSample_Check(id, man, state, bos, note); ScriptManager.RegisterClientScriptBlock(Page, GetType(), "alert", "alert('审核驳回')", true); Panel1.Visible = false; UpdatePanel1.Update(); TextBox9.Text = ""; BindGridview1(""); UpdatePanel_OutWeb.Update(); string remind = "ERP系统消息:" + Session["UserName"].ToString() + "于" + DateTime.Now.ToString("F") + "驳回了你提交的外来样品申请!"; string sendman = label18.Text; string sErr = RTXhelper.SendbyUserName(remind, sendman); if (!string.IsNullOrEmpty(sErr)) { ScriptManager.RegisterClientScriptBlock(Page, GetType(), "alert", "alert('" + sErr + "')", true); } }
//提交客户信息 protected void Button1_Com1(object sender, EventArgs e) { if (TextBox6.Text != "") { CRMNewCustormDevelopinfo.CRMCIF_ID = new Guid(label_SupplyID.Text.ToString()); CRMNewCustormDevelopinfo.CRMNCD_Man = Session["UserName"].ToString(); if (label_New.Text == "新增客户信息") { ccl.InsertCRMNewCustormDevelop(CRMNewCustormDevelopinfo); } if (label_New.Text == "修改客户信息") { CRMNewCustormDevelopinfo.CRMNCD_ID = new Guid(label_ManID.Text); ccl.UpdateCRMNewCustormDevelop_Info(CRMNewCustormDevelopinfo); } TextBox6.Text = ""; TextBox2.Text = ""; TextBox3.Text = ""; Panel_SampleNew.Visible = false; UpdatePanel_SampleNew.Update(); BindGridview1(""); UpdatePanel_OutWeb.Update(); } else { ScriptManager.RegisterClientScriptBlock(Page, GetType(), "aa", "alert('标记*的为必填项,请填写完整!')", true); return; } }
//重置 protected void Button3_Reset(object sender, EventArgs e) { BindGridview1(""); UpdatePanel_OutWeb.Update(); TextBox_Factory.Text = ""; TextBox1.Text = ""; DropDownList3.SelectedValue = "请选择"; UpdatePanel_OutsideSampleSearch.Update(); }
//修改、删除、分析 protected void Gridview1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Modify1")//修改 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Gridview1.SelectedIndex = row.RowIndex; label_SampleID.Text = e.CommandArgument.ToString(); label_New.Text = Gridview1.Rows[row.RowIndex].Cells[1].Text.ToString(); TextBox4.Text = Gridview1.Rows[row.RowIndex].Cells[7].Text.ToString(); TextBox6.Text = Gridview1.Rows[row.RowIndex].Cells[2].Text.ToString(); TextBox2.Text = Gridview1.Rows[row.RowIndex].Cells[5].Text.ToString(); DropDownList4.SelectedValue = Gridview1.Rows[row.RowIndex].Cells[6].Text.ToString(); TextBox7.Text = Gridview1.DataKeys[row.RowIndex]["CRMOS_Remark"].ToString(); Panel_SampleNew.Visible = true; UpdatePanel_SampleNew.Update(); } if (e.CommandName == "Delete1")//删除 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Gridview1.SelectedIndex = row.RowIndex; label_SampleID.Text = e.CommandArgument.ToString(); CRMOutsideSampleinfo.CRMOS_ID = new Guid(label_SampleID.Text.ToString()); cs.DeleteCRMOutsideSample(CRMOutsideSampleinfo); BindGridview1(""); UpdatePanel_OutWeb.Update(); ScriptManager.RegisterClientScriptBlock(UpdatePanel_OutWeb, GetType(), "alert", "alert('删除成功!')", true); return; } if (e.CommandName == "Analysis")//分析 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Gridview1.SelectedIndex = row.RowIndex; label_SampleID.Text = e.CommandArgument.ToString(); label_Result.Text = Gridview1.Rows[row.RowIndex].Cells[1].Text.ToString() + " " + Gridview1.Rows[row.RowIndex].Cells[2].Text.ToString(); TextBox14.Text = Gridview1.DataKeys[row.RowIndex]["CRMOS_AnalysisResult"].ToString(); Panel_Check.Visible = true; UpdatePanel_Check.Update(); } if (e.CommandName == "Check1") { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; label18.Text = Gridview1.Rows[row.RowIndex].Cells[4].Text.ToString(); label19.Text = e.CommandArgument.ToString(); Panel1.Visible = true; BindBos(); UpdatePanel1.Update(); } if (e.CommandName == "UP1") { Label46.Text = e.CommandArgument.ToString(); ShowPanel(); UpdatePanel_upload.Update(); } }
protected void Page_Load(object sender, EventArgs e) { if (!((Session["UserRole"].ToString().Contains("新客户开发")))) { Response.Redirect("~/Default.aspx"); } if (!IsPostBack) { BindGridview1(""); UpdatePanel_OutWeb.Update(); } }
//检索 protected void Button1_Sh(object sender, EventArgs e) { string condition = GetCondition(); BindGridview1(condition); UpdatePanel_OutWeb.Update(); Panel_SampleNew.Visible = false; UpdatePanel_SampleNew.Update(); Panel_Supply.Visible = false; UpdatePanel_Supply.Update(); Panel_Check.Visible = false; UpdatePanel_Check.Update(); }
protected void Page_Load(object sender, EventArgs e) { Title = "外来样品管理"; if (!((Session["UserRole"].ToString().Contains("外来样品")))) { Response.Redirect("~/Default.aspx"); } if (!IsPostBack) { BindBos(); BindGridview1(""); UpdatePanel_OutWeb.Update(); ClosePanel(); UpdatePanel_upload.Update(); } #region 权限 if (Request.QueryString["status"] == "Look")//外来样品查看 { Button3.Visible = false; Gridview1.Columns[22].Visible = true; //Gridview1.Columns[18].Visible = true; UpdatePanel_OutWeb.Update(); } if (Request.QueryString["status"] == "Edit")//外来样品维护 { Button3.Visible = true; Gridview1.Columns[22].Visible = true; Gridview1.Columns[17].Visible = true; Gridview1.Columns[18].Visible = true; UpdatePanel_OutWeb.Update(); } if (Request.QueryString["status"] == "Check")//外来样品审核 { Button3.Visible = false; Gridview1.Columns[22].Visible = true; Gridview1.Columns[19].Visible = true; UpdatePanel_OutWeb.Update(); } if (Request.QueryString["status"] == "Analysis")//外来样品分析 { Button3.Visible = false; Gridview1.Columns[20].Visible = true; Gridview1.Columns[21].Visible = true; Gridview1.Columns[22].Visible = true; UpdatePanel_OutWeb.Update(); } #endregion }
protected void ok_upload_Click(object sender, EventArgs e) { string fileExrensio = Path.GetExtension(FileUpload1.FileName).ToLower(); //ToLower转化为小写,获得扩展名 string UploadURL = Server.MapPath("~/file/"); //上传的目录 string fullname = FileUpload1.FileName; //上传文件的原名 string newname = DateTime.Now.ToString("yyyyMMddhhmmss"); //上传文件重命名 if (FileUpload1.PostedFile.FileName != null) { if (fileExrensio == ".doc" || fileExrensio == ".docx" || fileExrensio == ".pdf" || fileExrensio == ".xls" || fileExrensio == ".xlsx" || fileExrensio == ".txt")//判断文件扩展名 { try { if (!Directory.Exists(UploadURL)) //判断文件夹是否已经存在 { Directory.CreateDirectory(UploadURL); //创建文件夹 } FileUpload1.PostedFile.SaveAs(UploadURL + newname + fullname); //保存上传的文件 } catch { ScriptManager.RegisterClientScriptBlock(UpdatePanel_upload, GetType(), "aa", "alert('上传失败!')", true); return; } } else { ScriptManager.RegisterClientScriptBlock(UpdatePanel_upload, GetType(), "aa", "alert('不支持此文件格式!')", true); return; } } else { ScriptManager.RegisterClientScriptBlock(UpdatePanel_upload, GetType(), "aa", "alert('请选择文件!')", true); return; } string filePath = "file/" + newname + fullname; Guid TTD_DetailID = new Guid(Label46.Text.ToString()); string TTD_IsUploaded = "是"; string TTD_RepRoute = filePath; cs.UpdateCRMOutsideSample_up(TTD_DetailID, filePath); ClosePanel(); UpdatePanel_upload.Update(); BindGridview1(""); UpdatePanel_OutWeb.Update(); }
//编辑、删除、开发进度 protected void Gridview1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Modify1")//编辑 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Gridview1.SelectedIndex = row.RowIndex; label_ManID.Text = e.CommandArgument.ToString(); label_New.Text = "修改客户信息"; TextBox2.Text = Gridview1.Rows[row.RowIndex].Cells[2].Text.ToString(); TextBox6.Text = Gridview1.Rows[row.RowIndex].Cells[1].Text.ToString(); TextBox3.Text = Gridview1.Rows[row.RowIndex].Cells[3].Text.ToString(); Panel_SampleNew.Visible = true; UpdatePanel_SampleNew.Update(); } if (e.CommandName == "Delete1")//删除 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Gridview1.SelectedIndex = row.RowIndex; label_ManID.Text = e.CommandArgument.ToString(); CRMNewCustormDevelopinfo.CRMNCD_ID = new Guid(label_ManID.Text); ccl.DeleteCRMNewCustormDevelop(CRMNewCustormDevelopinfo); BindGridview1(""); UpdatePanel_OutWeb.Update(); ScriptManager.RegisterClientScriptBlock(UpdatePanel_OutWeb, GetType(), "aa", "alert('删除成功!')", true); return; } if (e.CommandName == "Analysis")//开发进度 { GridViewRow row = ((LinkButton)e.CommandSource).Parent.Parent as GridViewRow; Gridview1.SelectedIndex = row.RowIndex; label_ManID.Text = e.CommandArgument.ToString(); label9.Text = Gridview1.Rows[row.RowIndex].Cells[1].Text.ToString() + " " + Gridview1.Rows[row.RowIndex].Cells[2].Text.ToString() + " " + Gridview1.Rows[row.RowIndex].Cells[3].Text.ToString(); string condition; condition = "and CRMNCD_ID='" + label_ManID.Text + "'"; BindGridview2(condition); label9.Visible = true; if (Gridview2.Rows.Count > 0) { TextBox10.Text = Gridview2.Rows[0].Cells[2].Text.ToString(); } Panel_NewProgram.Visible = true; UpdatePanel_NewProgram.Update(); } }
//提交分析结论 protected void Button1_ComF(object sender, EventArgs e) { CRMOutsideSampleinfo.CRMOS_ID = new Guid(label_SampleID.Text.ToString()); if (TextBox14.Text != "") { CRMOutsideSampleinfo.CRMOS_State = "已分析"; CRMOutsideSampleinfo.CRMOS_AnalysisResult = TextBox14.Text.ToString(); string man = Session["UserName"].ToString(); cs.UpdateCRMOutsideSample_Analysis(CRMOutsideSampleinfo, man); TextBox14.Text = ""; Panel_Check.Visible = false; UpdatePanel_Check.Update(); BindGridview1(""); UpdatePanel_OutWeb.Update(); } else { ScriptManager.RegisterClientScriptBlock(UpdatePanel_Check, GetType(), "alert", "alert('标记*的为必填项,请填写完整!')", true); return; } }
//提交外送样品 protected void Button1_Com1(object sender, EventArgs e) { if (TextBox4.Text != "") { CRMOutsideSampleinfo.CRMOS_Num = Convert.ToDecimal(TextBox4.Text.ToString()); } else { ScriptManager.RegisterClientScriptBlock(UpdatePanel_SampleNew, GetType(), "alert", "alert('标记*的为必填项,请填写完整!')", true); return; } if (TextBox2.Text != "") { CRMOutsideSampleinfo.CRMOS_AlertDay = Convert.ToInt16(TextBox2.Text.ToString()); } else { ScriptManager.RegisterClientScriptBlock(UpdatePanel_SampleNew, GetType(), "alert", "alert('标记*的为必填项,请填写完整!')", true); return; } if (TextBox6.Text != "") { CRMOutsideSampleinfo.CRMOS_Factory = TextBox6.Text.ToString(); } else { ScriptManager.RegisterClientScriptBlock(UpdatePanel_SampleNew, GetType(), "alert", "alert('标记*的为必填项,请填写完整!')", true); return; } if (DropDownList4.SelectedValue != "请选择") { CRMOutsideSampleinfo.CRMOS_AnalysisReport = DropDownList4.SelectedValue.ToString(); } else { ScriptManager.RegisterClientScriptBlock(UpdatePanel_SampleNew, GetType(), "alert", "alert('标记*的为必填项,请填写完整!')", true); return; } if (TextBox7.Text != "") { CRMOutsideSampleinfo.CRMOS_Remark = TextBox7.Text.ToString(); } CRMOutsideSampleinfo.CRMOS_State = "已提交"; if (label_New.Text == "新增外送样品") { CRMOutsideSampleinfo.CRMOS_State = "已提交"; string man = Session["UserName"].ToString(); cs.InsertCRMOutsideSample(CRMOutsideSampleinfo, man); } else { CRMOutsideSampleinfo.CRMOS_ID = new Guid(label_SampleID.Text.ToString()); cs.UpdateCRMOutsideSample(CRMOutsideSampleinfo); } TextBox4.Text = ""; TextBox2.Text = ""; TextBox6.Text = ""; DropDownList4.SelectedValue = "请选择"; TextBox7.Text = ""; Panel_SampleNew.Visible = false; UpdatePanel_SampleNew.Update(); BindGridview1(""); UpdatePanel_OutWeb.Update(); string remind = "ERP系统消息:" + Session["UserName"].ToString() + "于" + DateTime.Now.ToString("F") + "提交了外来样品申请,请审核!"; string sErr = RTXhelper.Send(remind, "外来样品审核"); if (!string.IsNullOrEmpty(sErr)) { ScriptManager.RegisterClientScriptBlock(Page, GetType(), "alert", "alert('" + sErr + "')", true); } }