protected void BtnDel_Click(object sender, EventArgs e) { List <string> list = new List <string>(); if (this.HdnId.Value.Contains("[")) { list = JsonHelper.GetListFromJson(this.HdnId.Value); } else { list.Add(this.HdnId.Value); } int num = 0; try { for (int i = 0; i < list.Count; i++) { num = TechnologyJDAction.Del(list[i].ToString()); } if (num == 1) { this.Js.Text = "alert('删除成功!');"; this.TechnologyBind(this._PrjCode); } } catch (Exception) { this.Js.Text = "alert('删除失败!');"; } }
private void GetTechnologyOfUpd(string Id) { DataTable technologyOfSingle = TechnologyJDAction.GetTechnologyOfSingle(Id); this.TxtId.Text = technologyOfSingle.Rows[0]["SerialNumber"].ToString(); this.DateFill.Text = Convert.ToDateTime(technologyOfSingle.Rows[0]["FillDate"].ToString()).ToShortDateString(); this.TxtFillName.Text = technologyOfSingle.Rows[0]["FillName"].ToString(); this.HdnFill.Value = technologyOfSingle.Rows[0]["FillPeople"].ToString(); this.TxtPrjName.Text = technologyOfSingle.Rows[0]["PrejectName"].ToString(); this.TxtConUnit.Text = technologyOfSingle.Rows[0]["ConstructionUnit"].ToString(); this.TxtByTellUnit.Text = technologyOfSingle.Rows[0]["ByTellUnit"].ToString(); this.TxtTellName.Value = technologyOfSingle.Rows[0]["TellName"].ToString(); this.HdnTell.Value = technologyOfSingle.Rows[0]["TellPeople"].ToString(); this.TxtByTellName.Text = technologyOfSingle.Rows[0]["ByTellPeople"].ToString(); this.TxtTellLocus.Text = technologyOfSingle.Rows[0]["TellLocus"].ToString(); this.DateTellTime.Text = Convert.ToDateTime(technologyOfSingle.Rows[0]["TellDate"].ToString()).ToShortDateString(); this.TxtContentAbstract.Text = technologyOfSingle.Rows[0]["TellContentAbstract"].ToString(); this.TxtRemark.Text = technologyOfSingle.Rows[0]["Remark"].ToString(); this.hdnTechGuid.Value = technologyOfSingle.Rows[0]["TechGuid"].ToString(); this.hidenClass.Value = technologyOfSingle.Rows[0]["filesType"].ToString(); this.hidenMark.Value = technologyOfSingle.Rows[0]["mark"].ToString(); if (technologyOfSingle.Rows[0]["mark"].ToString() == "2") { this.cbkmark.Checked = false; return; } this.cbkmark.Checked = true; }
private void TechnologyBind(string PrjCode) { DataTable technologyList = TechnologyJDAction.GetTechnologyList(PrjCode); this.ViewState[TechnologyJDQuery.resourceTable] = technologyList; this.DGrdTechnology.DataSource = technologyList; this.DGrdTechnology.DataBind(); }
protected void BtnSave_Click(object sender, EventArgs e) { TechnologyTellLogic technologyTellLogic = new TechnologyTellLogic(); if (this.TxtId.Text.Trim() == "") { base.RegisterScript("top.ui.alert('编号不能为空!')"); return; } int mark; if (this.cbkmark.Checked) { mark = 3; } else { mark = 2; } TechnologyJDInfo technologyInfo = this.GetTechnologyInfo(); if (this._Type == "Add") { int num = TechnologyJDAction.Add(technologyInfo); if (num == 1) { technologyTellLogic.Update(mark, int.Parse(this.DDTClass.SelectedValue.ToString()), technologyTellLogic.GetMaxId()); base.RegisterScript("top.ui.tabSuccess({ parentName: '_flowclass' });"); this.BtnSave.Enabled = false; return; } base.RegisterScript("top.ui.alert('保存失败!'); "); return; } else { int num = TechnologyJDAction.Upd(technologyInfo); if (num == 1) { base.RegisterScript("top.ui.tabSuccess({ parentName: '_flowclass' });"); return; } base.RegisterScript("top.ui.alert('保存失败!'); "); return; } }
protected void Page_Load(object sender, EventArgs e) { if (!base.IsPostBack) { if (base.Request.QueryString["Type"] != null) { this._Type = base.Request.QueryString["Type"].ToString(); } if (base.Request.QueryString["pc"] != null) { this._PrjCode = base.Request.QueryString["pc"].ToString(); } if (base.Request.QueryString["pn"] != null) { this._PrjName = base.Request.QueryString["pn"].ToString(); } this.ViewState["TYPE"] = this._Type; this.ViewState["PRJCODE"] = this._PrjCode; this.ViewState["PRJNAME"] = this._PrjName; if (this._Type == "Upd") { this._Id = base.Request.QueryString["Id"].ToString(); this.TxtId.Enabled = false; this.GetTechnologyOfUpd(this._Id); this.lb_change.Text = "编辑技术交底"; this.FileLink1.Type = 1; } else { if (this._Type == "Add") { this.FileLink1.Type = 2; this.TxtId.Text = TechnologyJDAction.GetMaxId().ToString(); this.TxtId.Enabled = false; this.TxtPrjName.Text = this._PrjName; this.DateFill.Text = DateTime.Now.ToString("yyyy-MM-dd"); this.DateTellTime.Text = DateTime.Now.ToString("yyyy-MM-dd"); this.HdnFill.Value = userManageDb.GetCurrentUserInfo().UserCode; this.TxtFillName.Text = userManageDb.GetCurrentUserInfo().UserName; this.HdnTell.Value = userManageDb.GetCurrentUserInfo().UserCode; this.TxtTellName.Value = userManageDb.GetCurrentUserInfo().UserName; this.HdnByTell.Value = userManageDb.GetCurrentUserInfo().UserCode; this.TxtByTellName.Text = userManageDb.GetCurrentUserInfo().UserName; this.ViewState["RecordId"] = TechnologyJDAction.GetMaxId().ToString(); this._RecordId = this.ViewState["RecordId"].ToString(); this._Id = this.TxtId.Text; this.lb_change.Text = "新增技术交底"; this.hdnTechGuid.Value = Guid.NewGuid().ToString(); } else { if (this._Type == "View") { if (base.Request.QueryString["Id"] != null) { this._Id = base.Request.QueryString["Id"].ToString(); } if (base.Request.QueryString["ic"] != null) { string guid = base.Request.QueryString["ic"].ToString(); DataTable modelByGuid = TechnologyJDAction.GetModelByGuid(guid); this._Id = modelByGuid.Rows[0]["MainId"].ToString(); } this.FileLink1.Type = 0; this.FileLink1.Visible = false; this.BtnSave.Visible = false; this.SetControl(); this.TxtId.Enabled = false; this.GetTechnologyOfUpd(this._Id); this.lb_change.Text = "查看技术交底"; this.BunClose.Value = "关 闭"; if (this.cbkmark.Checked) { this.DDTClass.Enabled = false; } this.Img1.Disabled = true; this.TxtTellName.Disabled = true; this.Literal1.Text = FileView.FilesBind(1728, this.hdnTechGuid.Value.Trim()); } } } this.ViewState["ID"] = this._Id; this.FileLink1.MID = 1728; this.FileLink1.FID = this.hdnTechGuid.Value.Trim(); } else { this._Type = this.ViewState["TYPE"].ToString(); this._PrjCode = this.ViewState["PRJCODE"].ToString(); if (this._Type == "Add") { this._PrjName = this.ViewState["PRJNAME"].ToString(); this._RecordId = this.ViewState["RecordId"].ToString(); } else { this._PrjName = this.ViewState["PRJNAME"].ToString(); this._Id = this.ViewState["ID"].ToString(); } } com.jwsoft.pm.entpm.PageHelper.BindDropDownTree(this.DDTClass, 20, true); }