public void BindSource() { try { if (this.Items.Count > 0) { this.SetValue(); } else { EntityData dictionaryItemByNameProject = SystemManageDAO.GetDictionaryItemByNameProject(this._DictionaryName, this._ProjectCode); int count = dictionaryItemByNameProject.CurrentTable.Rows.Count; this.DataSource = dictionaryItemByNameProject; this.DataTextField = "Name"; this.DataValueField = "DictionaryItemCode"; this.DataBind(); dictionaryItemByNameProject.Dispose(); } this.DefaultSelect(); } catch (Exception exception) { throw exception; } }
public static void LoadDictionarySelect(DropDownList ddlDict, string dictionaryName, string selectedText, string selectedValue, string projectCode) { try { EntityData dictionaryItemByNameProject = SystemManageDAO.GetDictionaryItemByNameProject(dictionaryName, projectCode); int count = dictionaryItemByNameProject.CurrentTable.Rows.Count; for (int i = 0; i < count; i++) { dictionaryItemByNameProject.SetCurrentRow(i); ListItem item = new ListItem(dictionaryItemByNameProject.GetString("Name"), dictionaryItemByNameProject.GetString("DictionaryItemCode")); ddlDict.Items.Add(item); } dictionaryItemByNameProject.Dispose(); if (selectedValue != null) { ddlDict.SelectedIndex = ddlDict.Items.IndexOf(ddlDict.Items.FindByValue(selectedValue)); } else { ddlDict.SelectedIndex = ddlDict.Items.IndexOf(ddlDict.Items.FindByText(selectedText)); } } catch (Exception exception) { throw exception; } }
/// <summary> /// 原先的到点 /// </summary> /// <param name="operationCode"></param> /// <param name="userCode"></param> /// <param name="stationCodes"></param> /// <param name="tableName"></param> /// <param name="keyColumnName"></param> /// <returns></returns> public static string BuildAccessRangeString(string operationCode, string userCode, string stationCodes, string tableName, string keyColumnName) { string classCode = SystemManageDAO.GetFunctionStructureParentCode(operationCode); string codes = BuildStationCodeString(stationCodes); return(BuildAccessResourceString(operationCode, classCode, userCode, codes, tableName, keyColumnName)); }
public static DataTable GetUnitListByUserCode(string UserCode) { DataTable table2; try { DataTable tb = new DataTable(); DataColumn column = new DataColumn(); tb.Columns.Add("UnitCode"); tb.Columns.Add("UnitName"); EntityData userRoleByUserCode = SystemManageDAO.GetUserRoleByUserCode(UserCode); foreach (DataRow row in userRoleByUserCode.CurrentTable.Rows) { EntityData stationByCode = OBSDAO.GetStationByCode(row["StationCode"].ToString()); if (stationByCode.HasRecord()) { DataRow row2 = tb.NewRow(); row2["UnitCode"] = stationByCode.GetString("UnitCode"); row2["UnitName"] = GetUnitName(stationByCode.GetString("UnitCode")); tb.Rows.Add(row2); } stationByCode.Dispose(); } userRoleByUserCode.Dispose(); table2 = ConvertRule.GetDistinct(tb, "UnitCode", ""); } catch (Exception exception) { throw exception; } return(table2); }
public string BuildAccessTypeString(string operationCode, string userCode, string codes, string createUserColumnName) { string text = ""; string functionStructureParentCode = SystemManageDAO.GetFunctionStructureParentCode(operationCode); string queryString = string.Format(" select accessRange.groupCode,SystemGroup.FullID,RoleLevel from accessRange left join SystemGroup on accessRange.GroupCode=SystemGroup.GroupCode where OperationCode = '{0}' and (( AccessRangeType=0 and relationCode = '{1}' ) or ( AccessRangeType=1 and relationCode in ( {2} ) ) ) ", new object[] { operationCode, userCode, codes }); QueryAgent agent = new QueryAgent(); DataSet set = agent.ExecSqlForDataSet(queryString); agent.Dispose(); foreach (DataRow row in set.Tables[0].Rows) { if (!row.IsNull("FullID")) { string text4 = row["FullID"].ToString(); int num = 0; if (!row.IsNull("RoleLevel")) { num = (int)row["RoleLevel"]; } if (num == 0) { text = text + string.Format("or (CaseCode in ( Select a2.CaseCode from workflowCase a2 where a2.ProcedureCode in(select c1.ProcedureCode from WorkFlowProcedure c1 where isnull(c1.SysType, '') = '') and exists(select 1 from SystemGroup a1 where a1.GroupName in\t(dbo.GetProcedureNameByCaseCode(a2.CaseCode))\tand a1.ParentCode in (select a.GroupCode from SystemGroup a where a.GroupName =dbo.GetProjectNameByCaseCode(a2.CaseCode) and a.classcode='{1}') and a1.FullID like '{0}%'))\t)", text4, functionStructureParentCode); } } } return(text); }
public static void UpdateUserPwd(string UserCode, string NewPwd, string OwnName) { try { EntityData entity = SystemManageDAO.GetSystemUserByCode(UserCode); try { if (entity.HasRecord()) { DataRow currentRow = entity.CurrentRow; if (NewPwd != null) { currentRow["Password"] = NewPwd; } if (OwnName != null) { currentRow["OwnName"] = OwnName; } SystemManageDAO.UpdateSystemUser(entity); } } finally { entity.Dispose(); } } catch (Exception exception) { throw exception; } }
public static void UpdateProjectConfigValue(string ProjectCode, string ConfigName, object ConfigData) { try { DataRow currentRow; ProjectConfigStrategyBuilder builder = new ProjectConfigStrategyBuilder(); builder.AddStrategy(new Strategy(ProjectConfigStrategyName.ProjectCode, ProjectCode)); builder.AddStrategy(new Strategy(ProjectConfigStrategyName.ConfigName, ConfigName)); string queryString = builder.BuildMainQueryString(); QueryAgent agent = new QueryAgent(); EntityData entity = agent.FillEntityData("ProjectConfig", queryString); agent.Dispose(); if (entity.HasRecord()) { currentRow = entity.CurrentRow; } else { currentRow = entity.CurrentTable.NewRow(); currentRow["ProjectConfigCode"] = SystemManageDAO.GetNewSysCode("ProjectConfigCode"); currentRow["ProjectCode"] = ProjectCode; currentRow["ConfigName"] = ConfigName; entity.CurrentTable.Rows.Add(currentRow); } currentRow["ConfigData"] = ConfigData; SystemManageDAO.SubmitAllProjectConfig(entity); entity.Dispose(); } catch (Exception exception) { throw exception; } }
public static string GetSystemUserSubjectSetU8Code(string UserCode, string SubjectSetCode) { string text2; try { string text = ""; if (UserCode == "") { return(text); } EntityData systemUserSubjectSetByUser = SystemManageDAO.GetSystemUserSubjectSetByUser(UserCode, SubjectSetCode); if (systemUserSubjectSetByUser.HasRecord()) { text = systemUserSubjectSetByUser.GetString("U8Code"); } systemUserSubjectSetByUser.Dispose(); text2 = text; } catch (Exception exception) { throw exception; } return(text2); }
private EntityData BuildData() { EntityData designDocumentByCode; DataRow newRecord; bool flag = false; if (this._DesignDocumentCode == "") { flag = true; designDocumentByCode = this.GetDesignDocumentByCode(""); this._DesignDocumentCode = SystemManageDAO.GetNewSysCode("DesignDocument"); newRecord = designDocumentByCode.GetNewRecord(); } else { designDocumentByCode = this.GetDesignDocumentByCode(this._DesignDocumentCode); newRecord = designDocumentByCode.CurrentRow; } if (this._DesignDocumentCode != null) { newRecord["DesignDocumentCode"] = this._DesignDocumentCode; } if (this._Title != null) { newRecord["Title"] = this._Title; } if (this._ProjectCode != null) { newRecord["ProjectCode"] = this._ProjectCode; } if (this._UnitCode != null) { newRecord["UnitCode"] = this._UnitCode; } if (this._Context != null) { newRecord["Context"] = this._Context; } if (this._CreateDate != null) { newRecord["CreateDate"] = this._CreateDate; } if (this._CreateUser != null) { newRecord["CreateUser"] = this._CreateUser; } if (this._State != null) { newRecord["State"] = this._State; } if (this._Flag != null) { newRecord["Flag"] = this._Flag; } if (flag) { designDocumentByCode.AddNewRecord(newRecord); } return(designDocumentByCode); }
public static bool CheckUserAccountName(string userCode, string accountName) { bool flag2; try { DataRow[] rowArray; bool flag = true; EntityData allSystemUser = SystemManageDAO.GetAllSystemUser(); if (userCode == "") { rowArray = allSystemUser.CurrentTable.Select(string.Format("UserID='{0}'", accountName)); } else { rowArray = allSystemUser.CurrentTable.Select(string.Format("UserID='{0}' and UserCode<>'{1}' ", accountName, userCode)); } if (rowArray.Length > 0) { flag = false; } allSystemUser.Dispose(); flag2 = flag; } catch (Exception exception) { throw exception; } return(flag2); }
public void BindMoneyList() { try { if (this.DDl_MoneyTypeList.Items.Count <= 0) { if (this.Page.Cache["MoneyTypeList"] == null) { DataSet set; if (this._MoneyTypeSoure == null) { EntityData dictionaryItemByNameProject = SystemManageDAO.GetDictionaryItemByNameProject(this._DictionaryName, ""); set = dictionaryItemByNameProject; dictionaryItemByNameProject.Dispose(); } else { set = this._MoneyTypeSoure; } this.Page.Cache.Insert("MoneyTypeList", set, null, Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(25)); } this.DDl_MoneyTypeList.DataSource = (DataSet)this.Page.Cache["MoneyTypeList"]; this.DDl_MoneyTypeList.DataTextField = "Name"; this.DDl_MoneyTypeList.DataValueField = "DictionaryItemCode"; this.DDl_MoneyTypeList.DataBind(); } } catch (Exception exception) { throw exception; } }
private EntityData BuildData() { EntityData sendMsgByCode; DataRow newRecord; bool flag = false; if (this._SendMsgCode == "") { flag = true; sendMsgByCode = this.GetSendMsgByCode(""); this._SendMsgCode = SystemManageDAO.GetNewSysCode("SendMsg"); newRecord = sendMsgByCode.GetNewRecord(); } else { sendMsgByCode = this.GetSendMsgByCode(this._SendMsgCode); newRecord = sendMsgByCode.CurrentRow; } if (this._SendMsgCode != null) { newRecord["SendMsgCode"] = this._SendMsgCode; } if (this._SendUsercode != null) { newRecord["SendUsercode"] = this._SendUsercode; } if (this._ToUsercode != null) { newRecord["ToUsercode"] = this._ToUsercode; } if (this._Msg != null) { newRecord["Msg"] = this._Msg; } if (this._Sendtime != null) { newRecord["Sendtime"] = this._Sendtime; } if (this._State != null) { newRecord["State"] = this._State; } if (this._senddel != null) { newRecord["senddel"] = this._senddel; } if (this._todel != null) { newRecord["todel"] = this._todel; } if (this._Flag != null) { newRecord["Flag"] = this._Flag; } if (flag) { sendMsgByCode.AddNewRecord(newRecord); } return(sendMsgByCode); }
public static void SaveSalBudgetOneDtl(string ProjectCode, string BudgetCode, EntityData entityDtl, int y, int m, string PBSTypeCode, string FieldName, string val) { try { DataRow row; DataRow[] rowArray = entityDtl.CurrentTable.Select("IYear=" + y.ToString() + " and IMonth=" + m.ToString() + " and PBSTypeCode='" + PBSTypeCode + "'"); if (rowArray.Length == 0) { row = entityDtl.CurrentTable.NewRow(); row["BudgetCode"] = BudgetCode; row["SystemID"] = SystemManageDAO.GetNewSysCode("SalBudgetSystemID"); row["ProjectCode"] = ProjectCode; row["IYear"] = y; row["IMonth"] = m; row["PBSTypeCode"] = PBSTypeCode; entityDtl.CurrentTable.Rows.Add(row); } else { row = rowArray[0]; } row[FieldName] = ConvertRule.ToDecimalObj(val); } catch (Exception exception) { throw exception; } }
/// <summary> /// 添加相关人员 /// </summary> /// <param name="strTWBSCode"></param> /// <param name="strUser"></param> /// <param name="strUserType"></param> private void AddUser(string strTWBSCode, string strUser, string strUserType, string strCode) { strUser = CutRepeat(strUser); EntityData entityDelUser = WBSDAO.GetTaskPersonByWBSCode(strTWBSCode); DataView dv = entityDelUser.CurrentTable.DefaultView; dv.RowFilter = " Type = '" + strUserType + "' and RoleType='0' and ExecuteCode='" + strCode + "'"; foreach (DataRowView drv in dv) { EntityData entityMyUser = WBSDAO.GetTaskPersonByCode(drv["TaskPersonCode"].ToString()); WBSDAO.DeleteTaskPerson(entityMyUser); entityMyUser.Dispose(); } string[] arUser = strUser.Split(','); EntityData entityUser = new EntityData("TaskPerson"); foreach (string sUser in arUser) { DataRow drUser = entityUser.GetNewRecord(); User objUser = (User)Session["User"]; drUser["WBSCode"] = strTWBSCode; drUser["TaskPersonCode"] = SystemManageDAO.GetNewSysCode("TaskPerson"); drUser["UserCode"] = sUser; drUser["Type"] = strUserType; drUser["RoleType"] = '0'; drUser["ExecuteCode"] = this.txtTaskExecuteCode.Value; entityUser.AddNewRecord(drUser); WBSDAO.InsertTaskPerson(entityUser); } entityUser.Dispose(); this.txtUsers.Value = ""; }
public static string BuildTreeNodeSearchString(string systemGroupCode, TreeNodeSearchType searchType, string typeColumnName) { string systemGroupFullID = SystemManageDAO.GetSystemGroupFullID(systemGroupCode); switch (searchType) { case TreeNodeSearchType.AllSubNodeIncludeSelf: return(string.Format(" {1} in ( select GroupCode from SystemGroup where FullID like '{0}%' ) ", systemGroupFullID, typeColumnName)); case TreeNodeSearchType.AllSubNodeNotIncludeSelf: return(string.Format(" {1} in ( select GroupCode from SystemGroup where FullID FullCode like '{0}%' and FullID <> {'0'} ) ", systemGroupFullID, typeColumnName)); case TreeNodeSearchType.FirstChildNode: return(string.Format(" {1} in ( select GroupCode from SystemGroup where FullID = '{0}' ) ", systemGroupFullID, typeColumnName)); case TreeNodeSearchType.AllSubLeafNode: return(string.Format(" {1} in ( select GroupCode from SystemGroup c where FullID like '{0}%' and Not Exists ( select * from SystemGroup e where e.ParentCode = c.systemGroupCode ) ) ", systemGroupFullID, typeColumnName)); case TreeNodeSearchType.AllSubNotLeafNode: return(string.Format(" {1} in ( select GroupCode from SystemGroup c where FullID like '{0}%' and Exists ( select * from SystemGroup e where e.ParentCode = c.systemGroupCode ) ) ", systemGroupFullID, typeColumnName)); case TreeNodeSearchType.OnlySelfNode: return(string.Format(" {1} = '{0}' ) ", systemGroupCode, typeColumnName)); } return(""); }
public int UpdateMaterialInDtlList(SqlTransaction Transaction, List <MaterialInDtlModel> mObjs, int MaterialInCode) { try { MaterialInDtlDAL ldal = new MaterialInDtlDAL(Transaction); foreach (MaterialInDtlModel model in ldal.GetMaterialInDtlListByMaterialInCode(MaterialInCode)) { if (FindModel(mObjs, model.MaterialInDtlCode.ToString()) == null) { ldal.Delete(model.MaterialInDtlCode); } } foreach (MaterialInDtlModel model2 in mObjs) { if (model2.MaterialInDtlCode <= 0) { model2.MaterialInDtlCode = int.Parse(SystemManageDAO.GetNewSysCode("MaterialInDtlCode")); model2.MaterialInCode = MaterialInCode; ldal.Insert(model2); continue; } ldal.Update(model2); } } catch (Exception exception) { throw exception; } return(1); }
private string ImportSingle(string val) { try { string[] arr = ImportRule.SplitCsvLine(val); if (arr.Length < base.MinColCount) { return(string.Format("列不足{0}个", base.MinColCount)); } string text = arr[1].Trim(); if (text == "") { return("材料名称为空"); } string text2 = arr[0].Trim(); string text3 = ""; if (text2 != "") { DataRow[] rowArray = this.m_tbSystemGroup.Select("FullName = '" + text2 + "'"); if (rowArray.Length > 0) { text3 = rowArray[0]["GroupCode"].ToString(); } } if (text3 == "") { return(string.Format("未知的类型“{0}”", text2)); } MaterialDAL ldal = new MaterialDAL(this.conn); MaterialModel mObj = new MaterialModel(); mObj.MaterialCode = int.Parse(SystemManageDAO.GetNewSysCode("MaterialCode")); mObj.MaterialName = text; mObj.GroupCode = text3; mObj.Spec = ConvertRule.ToString(ConvertRule.GetArrayItem(arr, 2)).Trim(); mObj.Unit = ConvertRule.ToString(ConvertRule.GetArrayItem(arr, 3)).Trim(); mObj.InputPerson = this.InputPerson; try { if (ConvertRule.ToString(ConvertRule.GetArrayItem(arr, 4)).Trim() == "") { mObj.StandardPrice = 0M; } else { mObj.StandardPrice = decimal.Parse(ConvertRule.ToString(ConvertRule.GetArrayItem(arr, 4)).Trim()); } } catch { return(string.Format("参考价“{0}”不是有效的数值", ConvertRule.ToString(ConvertRule.GetArrayItem(arr, 4)).Trim())); } mObj.Remark = ConvertRule.ToString(ConvertRule.GetArrayItem(arr, 5)).Trim(); ldal.Insert(mObj); } catch (Exception exception) { throw exception; } return(""); }
private DataRow TaskPersonNewRow(DataTable tb, string Type, int RoleType, string RelationCode, string WBSCode) { try { DataRow drNew = null; if ((RelationCode == "") || (Type == "") || (WBSCode == "")) { return(drNew); } string filter = string.Format("Type='{0}' and isnull(RoleType,0)={1} and UserCode='{2}' and isnull(ExecuteCode, '')=''", Type, RoleType, RelationCode); if (tb.Select(filter).Length == 0) { drNew = tb.NewRow(); drNew["TaskPersonCode"] = SystemManageDAO.GetNewSysCode("TaskPerson"); drNew["Type"] = Type; drNew["WBSCode"] = WBSCode; drNew["RoleType"] = RoleType; drNew["UserCode"] = RelationCode; drNew["ExecuteCode"] = ""; tb.Rows.Add(drNew); } return(drNew); } catch (Exception ex) { throw ex; } }
/// <summary> /// 添加工作相关岗位 /// </summary> /// <param name="strTWBSCode"></param> /// <param name="strStation"></param> /// <param name="strStationType"></param> private void AddStation(string strTWBSCode, string strStation, string strUserType, string strCode) { strStation = CutRepeat(strStation); EntityData entityDelStation = WBSDAO.GetTaskPersonByWBSCode(strTWBSCode); DataView dv = entityDelStation.CurrentTable.DefaultView; dv.RowFilter = " Type = '" + strUserType + "' and RoleType='1' and ExecuteCode='" + strCode + "'"; foreach (DataRowView drv in dv) { EntityData entityMyStation = WBSDAO.GetTaskPersonByCode(drv["TaskPersonCode"].ToString()); WBSDAO.DeleteTaskPerson(entityMyStation); entityMyStation.Dispose(); } entityDelStation.Dispose(); string[] arStation = strStation.Split(','); EntityData entityStation = new EntityData("TaskPerson"); foreach (string sStation in arStation) { DataRow drStation = entityStation.GetNewRecord(); drStation["WBSCode"] = strTWBSCode; drStation["TaskPersonCode"] = SystemManageDAO.GetNewSysCode("TaskPerson"); drStation["UserCode"] = sStation; drStation["RoleType"] = "1"; // 1代表角色 drStation["Type"] = strUserType; drStation["ExecuteCode"] = this.txtTaskExecuteCode.Value; entityStation.AddNewRecord(drStation); WBSDAO.InsertTaskPerson(entityStation); } entityStation.Dispose(); }
private void LoadData() { string userCode = Request["UserCode"] + ""; try { EntityData ds = SystemManageDAO.GetStandard_SystemUserByCode(userCode); if (ds.HasRecord()) { this.lblUserID.Text = ds.GetString("UserID"); this.lblUserName.Text = ds.GetString("UserName"); this.lblShortName.Text = ds.GetString("ShortUserName"); this.lblEMail.Text = RmsPM.BLL.PageHelpDisplay.ChangeMessageForDisplay(ds.GetString("MailBox"), "</br>", ';'); this.lblPhone.Text = ds.GetString("Phone"); this.lblMobile.Text = ds.GetString("Mobile"); this.lblAddress.Text = ds.GetString("Address"); this.lblFax.Text = ds.GetString("Fax"); this.lblBirthDay.Text = ds.GetDateTimeOnlyDate("BirthDay"); this.lblPhoneHome.Text = ds.GetString("PhoneHome"); this.lblSortID.Text = ds.GetString("SortID"); this.tdStationName.InnerHtml = BLL.SystemRule.GetUserStationNameHtml(userCode); this.lblSex.Text = ds.GetString("Sex"); int status = ds.GetInt("Status"); if (status == 1) { this.lblU.Text = "禁用"; } else { this.lblU.Text = "启用"; } } //显示财务编码 this.lblSubjectSetDesc.Text = BLL.FinanceRule.GetFinanceSubjectSetDesc(ds.Tables["SystemUserSubjectSet"]); ds.Dispose(); // RoleStrategyBuilder sb = new RoleStrategyBuilder(); // sb.AddStrategy( new Strategy( RoleStrategyName.UserCode,userCode )); // string sql = sb.BuildMainQueryString(); // QueryAgent qa = new QueryAgent(); // EntityData entity = qa.FillEntityData("Role",sql); // this.dgList.DataSource = entity.CurrentTable; // this.dgList.DataBind(); // entity.Dispose(); // qa.Dispose(); } catch (Exception ex) { ApplicationLog.WriteLog(this.ToString(), ex, ""); Response.Write(Rms.Web.JavaScript.Alert(true, "显示出错")); } }
private EntityData BuildData() { EntityData data2; try { EntityData gradeConsiderPercentageByCode; DataRow newRecord; bool flag = false; if (this._ConsiderPercentageCode == "") { flag = true; gradeConsiderPercentageByCode = GetGradeConsiderPercentageByCode("", this.dao); this._ConsiderPercentageCode = SystemManageDAO.GetNewSysCode("GradeConsiderPercentage"); newRecord = gradeConsiderPercentageByCode.GetNewRecord(); } else { gradeConsiderPercentageByCode = GetGradeConsiderPercentageByCode(this._ConsiderPercentageCode, this.dao); if (gradeConsiderPercentageByCode.Tables[0].Rows.Count <= 0) { newRecord = gradeConsiderPercentageByCode.GetNewRecord(); flag = true; } else { newRecord = gradeConsiderPercentageByCode.CurrentRow; } } if (this._ConsiderPercentageCode != null) { newRecord["ConsiderPercentageCode"] = this._ConsiderPercentageCode; } if (this._MainDefineCode != null) { newRecord["MainDefineCode"] = this._MainDefineCode; } if (this._GradeMessageCode != null) { newRecord["GradeMessageCode"] = this._GradeMessageCode; } if (this._ConsiderDiathesisCode != null) { newRecord["ConsiderDiathesisCode"] = this._ConsiderDiathesisCode; } newRecord["Percentage"] = this._Percentage; if (flag) { gradeConsiderPercentageByCode.AddNewRecord(newRecord); } data2 = gradeConsiderPercentageByCode; } catch (Exception exception) { throw exception; } return(data2); }
public static string BuildAccessRangeStringNoGroupCode(string operationCode, string userCode, string stationCodes, string tableName, string keyColumnName, string typeColumnName, string createUserColumnName) { string classCode = SystemManageDAO.GetFunctionStructureParentCode(operationCode); string codes = BuildStationCodeString(stationCodes); string text3 = BuildAccessResourceString(operationCode, classCode, userCode, codes, tableName, keyColumnName, createUserColumnName); string text4 = BuildAccessTypeStringNoGroupCode(operationCode, classCode, userCode, codes, tableName, keyColumnName, typeColumnName, createUserColumnName); return(string.Format("( {0} {1} )", text3, text4)); }
public int UpdateMaterialOutDtlList(SqlTransaction Transaction, List <MaterialOutDtlModel> mObjs, int MaterialOutCode) { try { MaterialOutDtlDAL ldal = new MaterialOutDtlDAL(Transaction); Hashtable hashtable = new Hashtable(); foreach (MaterialOutDtlModel model in ldal.GetMaterialOutDtlListByMaterialOutCode(MaterialOutCode)) { if (!hashtable.Contains(model.MaterialInDtlCode)) { hashtable.Add(model.MaterialInDtlCode, model.MaterialInDtlCode); } if (FindModel(mObjs, model.MaterialOutDtlCode.ToString()) == null) { ldal.Delete(model.MaterialOutDtlCode); } } foreach (MaterialOutDtlModel model2 in mObjs) { if (!hashtable.Contains(model2.MaterialInDtlCode)) { hashtable.Add(model2.MaterialInDtlCode, model2.MaterialInDtlCode); } if (model2.MaterialOutDtlCode <= 0) { model2.MaterialOutDtlCode = int.Parse(SystemManageDAO.GetNewSysCode("MaterialOutDtlCode")); model2.MaterialOutCode = MaterialOutCode; ldal.Insert(model2); continue; } ldal.Update(model2); } IEnumerator enumerator = hashtable.Keys.GetEnumerator(); try { while (enumerator.MoveNext()) { int current = (int)enumerator.Current; string commandText = "update MaterialInDtl set OutQty = (select sum(isnull(OutQty, 0)) from MaterialOutDtl where MaterialInDtlCode = MaterialInDtl.MaterialInDtlCode)"; ldal._DataProcess.RunSql(commandText); } } finally { IDisposable disposable = enumerator as IDisposable; if (disposable != null) { disposable.Dispose(); } } } catch (Exception exception) { throw exception; } return(1); }
public static void NewYearConstructAnnualPlan(string ProjectCode, int IYear, string UserCode) { try { if ((ProjectCode != "") && (IYear > 0)) { DataRow drDst; int num = IYear + 1; EntityData constructPlanStepByProjectYear = ConstructDAO.GetConstructPlanStepByProjectYear(ProjectCode, IYear); EntityData entity = new EntityData("ConstructPlanStep"); foreach (DataRow row in constructPlanStepByProjectYear.CurrentTable.Rows) { drDst = entity.CurrentTable.NewRow(); ConvertRule.DataRowCopy(row, drDst, constructPlanStepByProjectYear.CurrentTable, entity.CurrentTable); drDst["ConstructPlanStepCode"] = SystemManageDAO.GetNewSysCode("ConstructPlanStepCode"); drDst["IYear"] = num; entity.CurrentTable.Rows.Add(drDst); } ConstructDAO.InsertConstructPlanStep(entity); entity.Dispose(); constructPlanStepByProjectYear.Dispose(); EntityData data3 = PBSDAO.GetV_PBSUnitByProject(ProjectCode); EntityData constructAnnualPlanByProjectYear = ConstructDAO.GetConstructAnnualPlanByProjectYear(ProjectCode, IYear); entity = new EntityData("ConstructAnnualPlan"); foreach (DataRow row3 in data3.CurrentTable.Rows) { string pBSUnitCode = ConvertRule.ToString(row3["PBSUnitCode"]); string code = ConvertRule.ToString(row3["VisualProgress"]); decimal num2 = ConvertRule.ToDecimal(row3["TotalBuildArea"]); drDst = entity.CurrentTable.NewRow(); drDst["AnnualPlanCode"] = SystemManageDAO.GetNewSysCode("AnnualPlanCode"); entity.CurrentTable.Rows.Add(drDst); drDst["IYear"] = num; drDst["PBSUnitCode"] = pBSUnitCode; drDst["ProjectCode"] = ProjectCode; drDst["PlanDate"] = DateTime.Now; drDst["PlanPerson"] = UserCode; decimal num3 = CalcPBSUnitCompleteInvest(pBSUnitCode); drDst["InvestBefore"] = num3; EntityData visualProgressByCode = ConstructDAO.GetVisualProgressByCode(code); if (visualProgressByCode.HasRecord() && (visualProgressByCode.GetInt("ProgressType") >= 0)) { drDst["LCFArea"] = num2; } visualProgressByCode.Dispose(); ConstructDAO.InsertConstructAnnualPlan(entity); } entity.Dispose(); constructAnnualPlanByProjectYear.Dispose(); data3.Dispose(); } } catch (Exception exception) { throw exception; } }
private void SaveToolsButton_ServerClick(object sender, System.EventArgs e) { string WBSCode = Request.QueryString["WBSCode"]; EntityData entityUser = WBSDAO.GetTaskPersonByWBSCode(WBSCode); WBSDAO.DeleteTaskPerson(entityUser); try { DataRow dr; //责任人 dr = entityUser.GetNewRecord(); dr["TaskPersonCode"] = SystemManageDAO.GetNewSysCode("TaskPersonCode"); dr["WBSCode"] = WBSCode; dr["MainTask"] = this.txtMasterDetail.Value.Trim(); dr["UserCode"] = this.hMasterCode.Value; dr["Type"] = 2; entityUser.AddNewRecord(dr); //监督人 dr = entityUser.GetNewRecord(); dr["TaskPersonCode"] = SystemManageDAO.GetNewSysCode("TaskPersonCode"); dr["WBSCode"] = WBSCode; dr["MainTask"] = this.txtMonitorDetail.Value.Trim(); dr["UserCode"] = this.hMonitorCode.Value; dr["Type"] = 1; entityUser.AddNewRecord(dr); //执行人 System.Web.UI.WebControls.TextBox objText = new TextBox(); foreach (DataGridItem oDataGridItem in this.dgUserList.Items) { objText = (TextBox)oDataGridItem.FindControl("txtExecuterDetail"); dr = entityUser.GetNewRecord(); dr["TaskPersonCode"] = SystemManageDAO.GetNewSysCode("TaskPersonCode"); dr["WBSCode"] = WBSCode; dr["UserCode"] = this.dgUserList.DataKeys[oDataGridItem.ItemIndex]; dr["MainTask"] = objText.Text.Trim(); dr["Type"] = 0; entityUser.AddNewRecord(dr); } WBSDAO.SubmitAllTaskPerson(entityUser); entityUser.Dispose(); } catch (Exception ex) { ApplicationLog.WriteLog(this.ToString(), ex, "保存相关人员失败"); } Response.Write(JavaScript.ScriptStart); Response.Write("window.opener.Select('Base','');"); Response.Write("window.close();"); Response.Write(JavaScript.ScriptEnd); }
public static string SetResourceAccessRange(string code, string classCode, string unitCode, ArrayList ar, bool isRefreshRight) { string text3; try { string resourceCode = GetResourceCode(code, classCode); bool flag = resourceCode == ""; EntityData entity = null; if (flag) { resourceCode = SystemManageDAO.GetNewSysCode("ResourceCode"); entity = new EntityData("Standard_Resource"); DataRow newRecord = entity.GetNewRecord(); newRecord["ResourceCode"] = resourceCode; newRecord["ClassCode"] = classCode; newRecord["UnitCode"] = unitCode; newRecord["RelationCode"] = code; entity.AddNewRecord(newRecord); } else { entity = ResourceDAO.GetStandard_ResourceByCode(resourceCode); entity.CurrentRow["unitCode"] = unitCode; } if (isRefreshRight) { entity.DeleteAllTableRow("AccessRange"); } entity.SetCurrentTable("AccessRange"); int count = ar.Count; for (int i = 0; i < count; i++) { AccessRange range = (AccessRange)ar[i]; foreach (string text2 in range.Operations.Split(new char[] { ',' })) { DataRow row = entity.GetNewRecord(); row["AccessRangeCode"] = SystemManageDAO.GetNewSysCode("AccessRangeCode"); row["ResourceCode"] = resourceCode; row["UnitCode"] = unitCode; row["OperationCode"] = text2; row["AccessRangeType"] = range.AccessRangeType; row["RelationCode"] = range.RelationCode; entity.AddNewRecord(row); } } ResourceDAO.SubmitAllStandard_Resource(entity); entity.Dispose(); text3 = resourceCode; } catch (Exception exception) { throw exception; } return(text3); }
private EntityData BuildData() { EntityData gradeMessageByCode; DataRow newRecord; bool flag = false; if (this._GradeMessageCode == "") { flag = true; gradeMessageByCode = this.GetGradeMessageByCode(""); this._GradeMessageCode = SystemManageDAO.GetNewSysCode("GradeMessage"); newRecord = gradeMessageByCode.GetNewRecord(); } else { gradeMessageByCode = this.GetGradeMessageByCode(this._GradeMessageCode); newRecord = gradeMessageByCode.CurrentRow; } if (this._GradeMessageCode != null) { newRecord["GradeMessageCode"] = this._GradeMessageCode; } if (this._ProjectCode != null) { newRecord["ProjectCode"] = this._ProjectCode; } if (this._SupplierCode != null) { newRecord["SupplierCode"] = this._SupplierCode; } if (this._MainDefineCode != null) { newRecord["MainDefineCode"] = this._MainDefineCode; } if (this._ProjectManage != null) { newRecord["ProjectManage"] = this._ProjectManage; } if (this._ProduceName != null) { newRecord["ProduceName"] = this._ProduceName; } if (this._CreateDate != null) { newRecord["CreateDate"] = this._CreateDate; } if (this._State != null) { newRecord["State"] = this._State; } if (flag) { gradeMessageByCode.AddNewRecord(newRecord); } return(gradeMessageByCode); }
private EntityData BuildData() { EntityData templateOpinionByCode; DataRow newRecord; bool flag = false; if (this._TemplateOpinionCode == "") { flag = true; templateOpinionByCode = this.GetTemplateOpinionByCode(""); this._TemplateOpinionCode = SystemManageDAO.GetNewSysCode("TemplateOpinion"); newRecord = templateOpinionByCode.GetNewRecord(); } else { templateOpinionByCode = this.GetTemplateOpinionByCode(this._TemplateOpinionCode); newRecord = templateOpinionByCode.CurrentRow; } if (this._TemplateOpinionCode != null) { newRecord["TemplateOpinionCode"] = this._TemplateOpinionCode; } if (this._Number != null) { newRecord["Number"] = this._Number; } if (this._Name != null) { newRecord["Name"] = this._Name; } if (this._Center != null) { newRecord["Center"] = this._Center; } if (this._Type != null) { newRecord["Type"] = this._Type; } if (this._UserCode != null) { newRecord["UserCode"] = this._UserCode; } if (this._State != null) { newRecord["State"] = this._State; } if (this._Flag != null) { newRecord["Flag"] = this._Flag; } if (flag) { templateOpinionByCode.AddNewRecord(newRecord); } return(templateOpinionByCode); }
private EntityData BuildData() { EntityData emailHistoryByCode; DataRow newRecord; bool flag = false; if (this._EmailHistoryCode == "") { flag = true; emailHistoryByCode = this.GetEmailHistoryByCode(""); this._EmailHistoryCode = SystemManageDAO.GetNewSysCode("EmailHistory"); newRecord = emailHistoryByCode.GetNewRecord(); } else { emailHistoryByCode = this.GetEmailHistoryByCode(this._EmailHistoryCode); newRecord = emailHistoryByCode.CurrentRow; } if (this._EmailHistoryCode != null) { newRecord["EmailHistoryCode"] = this._EmailHistoryCode; } if (this._EmailType != null) { newRecord["EmailType"] = this._EmailType; } if (this._MasterCode != null) { newRecord["MasterCode"] = this._MasterCode; } if (this._EmailTitle != null) { newRecord["EmailTitle"] = this._EmailTitle; } if (this._Receiver != null) { newRecord["Receiver"] = this._Receiver; } if (this._Sender != null) { newRecord["Sender"] = this._Sender; } if (this._EmailContent != null) { newRecord["EmailContent"] = this._EmailContent; } if (this._SendDate != null) { newRecord["SendDate"] = this._SendDate; } if (flag) { emailHistoryByCode.AddNewRecord(newRecord); } return(emailHistoryByCode); }
private EntityData BuildData() { EntityData data2; try { EntityData biddingGradeByCode; DataRow newRecord; bool flag = false; if (this._BiddingGradeCode == "") { flag = true; biddingGradeByCode = GetBiddingGradeByCode(""); this._BiddingGradeCode = SystemManageDAO.GetNewSysCode("BiddingGrade"); newRecord = biddingGradeByCode.GetNewRecord(); } else { biddingGradeByCode = GetBiddingGradeByCode(this._BiddingGradeCode); if (biddingGradeByCode.Tables[0].Rows.Count <= 0) { newRecord = biddingGradeByCode.GetNewRecord(); flag = true; } else { newRecord = biddingGradeByCode.CurrentRow; } } if (this._BiddingGradeCode != null) { newRecord["BiddingGradeCode"] = this._BiddingGradeCode; } if (this._BiddingGradeMessageCode != null) { newRecord["BiddingGradeMessageCode"] = this._BiddingGradeMessageCode; } if (this._BiddingConsiderDiathesisCode != null) { newRecord["BiddingConsiderDiathesisCode"] = this._BiddingConsiderDiathesisCode; } newRecord["GradePoint"] = this._GradePoint; if (flag) { biddingGradeByCode.AddNewRecord(newRecord); } data2 = biddingGradeByCode; } catch (Exception exception) { throw exception; } return(data2); }