/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { Model.T_CellTmp_MDL model = new DigiPower.Onlinecol.Standard.Model.T_CellTmp_MDL(); BLL.T_CellTmp_BLL bll = new DigiPower.Onlinecol.Standard.BLL.T_CellTmp_BLL(); if (Convert.ToInt32(ID) != 0) { model = bll.GetModel(Convert.ToInt32(ID)); } model = (Model.T_CellTmp_MDL)Comm.GetValueToObject(model, this.tbl); string UploadFileNameResult = UploadCellFile(); if (UploadFileNameResult != "") { model.FilePath = UploadFileNameResult; } if (Convert.ToInt32(ID) == 0) { ID = bll.Add(model).ToString(); } else { bll.Update(model); } Response.Redirect("CellList.aspx?sqlwhere=" + SqlWhere + "&PageIndex=" + pPageIndex + ""); }
///// <summary> ///// 保存 ///// </summary> ///// <param name="sender"></param> ///// <param name="e"></param> //protected void btnAdd_Click(object sender, EventArgs e) //{ // //Response.Redirect("ArchiveCellReportAdd.aspx?Action=add&ID=0&recid="+ID+"&sqlwhere = " + SqlWhere + ""); // //List<string> sellist = ctrlGridEx1.GetSelects(); // //if (sellist.Count > 0) // //{ // //T_SingleProject_MDL model = (new T_SingleProject_BLL()).GetModel(ConvertEx.ToInt(sellist[0].ToString())); // //} //} private void SaveSelect() { //try //{ string SelectIDList = Common.Session.GetSession("SelectIDList"); if (!String.IsNullOrEmpty(SelectIDList)) { //List<string> SelectList = (List<string>)Session["SelectList"]; BLL.T_CellTmp_BLL bll1 = new DigiPower.Onlinecol.Standard.BLL.T_CellTmp_BLL(); BLL.T_FileListTmp_CellRptTmp_BLL bll2 = new DigiPower.Onlinecol.Standard.BLL.T_FileListTmp_CellRptTmp_BLL(); foreach (string CellReportID in SelectIDList.Split(',')) { if (CellReportID != "" && !bll2.Exists("recID=" + ID + " AND CellFilePath='" + CellReportID + "'")) { Model.T_CellTmp_MDL mdl = bll1.GetModel(Common.ConvertEx.ToInt(CellReportID)); if (mdl != null) { Model.T_FileListTmp_CellRptTmp_MDL mdl2 = new DigiPower.Onlinecol.Standard.Model.T_FileListTmp_CellRptTmp_MDL(); mdl2.CellFilePath = CellReportID; mdl2.recID = Common.ConvertEx.ToInt(ID); mdl2.Title = mdl.Title; mdl2.OrderIndex = Common.ConvertEx.ToInt(mdl.OrderIndex); bll2.Add(mdl2); } } } Session["SelectIDList"] = null; } //} //catch { Session["SelectIDList"] = null; } }
protected void PID_SelectedIndexChanged(object sender, EventArgs e) { BLL.T_CellTmp_BLL docBLL = new DigiPower.Onlinecol.Standard.BLL.T_CellTmp_BLL(); Model.T_CellTmp_MDL docMDL = docBLL.GetModel(Common.ConvertEx.ToInt(PID.SelectedValue)); if (docMDL != null) { PID_Show.Text = docMDL.MyCode; } }
/// <summary> /// 绑定页面 /// </summary> /// <param name="ID"></param> private void BindPage(string ID) { Model.T_CellTmp_MDL model = new DigiPower.Onlinecol.Standard.Model.T_CellTmp_MDL(); BLL.T_CellTmp_BLL bll = new DigiPower.Onlinecol.Standard.BLL.T_CellTmp_BLL(); model = bll.GetModel(Convert.ToInt32(ID)); DigiPower.Onlinecol.Standard.Web.Comm.SetValueToPage(model, this.tbl); if (model != null) { FilePath.Text = model.FilePath; } }
/// <summary> /// 删除 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnDelete_Click(object sender, EventArgs e) { DigiPower.Onlinecol.Standard.BLL.T_CellTmp_BLL bll = new DigiPower.Onlinecol.Standard.BLL.T_CellTmp_BLL(); if (ctrlGridEx1.GetSelects().Count > 0) { for (int i = 0; i < ctrlGridEx1.GetSelects().Count; i++) { bll.Delete(Convert.ToInt32(ctrlGridEx1.GetSelects()[i])); } } this.BindGridView(); }
/// <summary> /// 绑定列表 /// </summary> private void BindGridView() { BLL.T_CellTmp_BLL bll = new DigiPower.Onlinecol.Standard.BLL.T_CellTmp_BLL(); DataSet ds = new DataSet(); ds = bll.GetList(""); if (ds.Tables.Count > 0) { DataTable outDT = ds.Tables[0].Copy(); outDT.Clear(); Recursion(ds.Tables[0], 0, 0, ref outDT); ds.Tables.Clear(); ds.Tables.Add(outDT); if (ViewState["sqlwhere"] != null && !String.IsNullOrEmpty(ViewState["sqlwhere"].ToString())) { if (ds.Tables.Count > 0) { DataView dv = ds.Tables[0].Copy().DefaultView; dv.RowFilter = ViewState["sqlwhere"].ToString(); if (dv.Count != ds.Tables[0].Rows.Count) { ds.Tables[0].Clear(); ds.Tables.RemoveAt(0); ds.Tables.Add(dv.ToTable()); } } } List <string> l1 = new List <string>(); l1.Add("Title"); l1.Add("FilePath"); //l1.Add("JS"); //l1.Add("SG"); //l1.Add("SJ"); //l1.Add("JL"); //l1.Add("NeedArchive"); //l1.Add("IsFolder"); //l1.Add("archive_form_name"); l1.Add("OrderIndex"); //ctrlGridEx1.PageCount = Common.ConvertEx.ToInt(Common.Session.GetSession("PageCount")); ctrlGridEx1.InitGrid("CellID", l1, ds, "~/SystemManage/CellListAdd.aspx?Action=edit"); } }
private void InitComboxParent() { BLL.T_CellTmp_BLL bll = new DigiPower.Onlinecol.Standard.BLL.T_CellTmp_BLL(); DataSet ds = new DataSet(); ds = bll.GetList(""); if (ds.Tables.Count > 0) { DataTable outDT = ds.Tables[0].Copy(); outDT.Clear(); Recursion(ds.Tables[0], 0, 0, ref outDT); DataRow newRow = outDT.NewRow(); newRow["CellID"] = "0"; newRow["Title"] = "无父类"; outDT.Rows.InsertAt(newRow, 0); PID.DataTextField = "Title"; PID.DataValueField = "CellID"; PID.DataSource = outDT; PID.DataBind(); } }