/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { T_FileListTmp_MDL model = new T_FileListTmp_MDL(); if (ViewState["model"] != null) { model = (Model.T_FileListTmp_MDL)ViewState["model"]; } object obj = Comm.GetValueToObject(model, this.tbl); if (obj != null) { Model.T_FileListTmp_MDL Newmodel = (Model.T_FileListTmp_MDL)obj; switch ((CommonEnum.PageState)ViewState["ps"]) { case CommonEnum.PageState.ADD: ID = fileTmpBLL.Add(Newmodel).ToString(); PublicModel.writeLog(SystemSet.EumLogType.AddData.ToString(), string.Concat("T_FileListTmp;key=", ID, ";archive_form_no=", Newmodel.archive_form_no, ";bh=", Newmodel.bh, ";title=", Newmodel.title)); break; case CommonEnum.PageState.EDIT: { Newmodel.recid = Convert.ToInt32(ID); fileTmpBLL.Update(Newmodel); PublicModel.writeLog(SystemSet.EumLogType.UpdData.ToString(), string.Concat("T_FileListTmp;key=", Newmodel.recid, ";archive_form_no=", Newmodel.archive_form_no, ";bh=", Newmodel.bh, ";title=", Newmodel.title)); } break; } } Common.MessageBox.CloseLayerOpenWeb(this.Page); }
//public string addempty(string name, int ll_i)//填补空格 //{ // for (int i = 0; i < ll_i; i++) // { // name = " " + name; // } // return name; //} protected void ddlModule_SelectedIndexChanged(object sender, EventArgs e) { BLL.T_FileListTmp_BLL docBLL = new T_FileListTmp_BLL(); Model.T_FileListTmp_MDL docMDL = docBLL.GetModel(Common.ConvertEx.ToInt(ddlModule.SelectedValue)); if (docMDL != null) { Label1.Text = docMDL.bh; } }
/// <summary> /// 文件登记中新增条目 /// mustsubmitflag 是由档案馆勾选确认的 ,默认为false /// </summary> /// <param name="SingleProjectID"></param> /// <param name="modelIn"></param> /// <returns></returns> public int Add(string SingleProjectID, DigiPower.Onlinecol.Standard.Model.T_FileListTmp_MDL modelIn) { DigiPower.Onlinecol.Standard.Model.T_FileListTmp_MDL modelNew = modelIn; //先要确保父类存在 BLL.T_FileListTmp_BLL tplBLL = new T_FileListTmp_BLL(); Model.T_FileListTmp_MDL tplMDL = tplBLL.GetModel(modelNew.PID); if (tplMDL != null) { Add(SingleProjectID, tplMDL); //modelNew = tplMDL;//要加父model } if (modelNew.IsFolder == true) { if (!dal.Exists(SingleProjectID, modelNew.recid)) { dal.Add(SingleProjectID, Common.Session.GetSession("CompanyID"), Common.Session.GetSession("UserID"), Common.Session.GetSession("UserName"), modelNew); } } else { //DataSet ds = dal.GetList("SingleProjectID=" + SingleProjectID + " AND (BH='" + modelNew.bh + "' OR BH LIKE '" + modelNew.bh + "-%')") //DataSet ds = dal.GetList("SingleProjectID=" + SingleProjectID + " AND BH='" + modelNew.bh + "'"); DataSet ds = dal.GetList("SingleProjectID=" + SingleProjectID + " AND BH LIKE '" + modelNew.bh + "%' AND CompanyID=" + Common.Session.GetSession("CompanyID") + ""); bool bAdd = true; if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) //如果原来的存在,更新编号后,再加一条 { modelNew.bh = modelNew.bh + "-" + (ds.Tables[0].Rows.Count); if (ds.Tables[0].Rows.Count > 3) //Leo 2012-12-17 最多只给用户加3条,多的,不可以加,否则用户读取时很容易超时 { bAdd = false; } } if (bAdd == true) { dal.Add(SingleProjectID, Common.Session.GetSession("CompanyID"), Common.Session.GetSession("UserID"), Common.Session.GetSession("UserName"), modelNew); } } return(0); }