Exemplo n.º 1
0
 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;
     }
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        /// <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 = "";
        }
Exemplo n.º 5
0
 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;
     }
 }
Exemplo n.º 6
0
        /// <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();
        }
Exemplo n.º 7
0
 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("");
 }
Exemplo n.º 8
0
        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;
            }
        }
Exemplo n.º 9
0
 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);
 }
Exemplo n.º 10
0
        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);
        }
Exemplo n.º 11
0
 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);
 }
Exemplo n.º 12
0
 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;
     }
 }
Exemplo n.º 13
0
        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);
        }
Exemplo n.º 14
0
        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);
        }
Exemplo n.º 15
0
        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);
        }
Exemplo n.º 16
0
        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);
        }
Exemplo n.º 17
0
        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);
        }
Exemplo n.º 18
0
        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);
        }
Exemplo n.º 19
0
        private EntityData BuildData()
        {
            EntityData biddingReturnCostByCode;
            DataRow    newRecord;
            bool       flag = false;

            if (this._BiddingReturnCostCode == "")
            {
                flag = true;
                biddingReturnCostByCode     = this.GetBiddingReturnCostByCode("");
                this._BiddingReturnCostCode = SystemManageDAO.GetNewSysCode("BiddingReturnCost");
                newRecord = biddingReturnCostByCode.GetNewRecord();
            }
            else
            {
                biddingReturnCostByCode = this.GetBiddingReturnCostByCode(this._BiddingReturnCostCode);
                newRecord = biddingReturnCostByCode.CurrentRow;
            }
            if (this._BiddingReturnCode != null)
            {
                newRecord["BiddingReturnCode"] = this._BiddingReturnCode;
            }
            if (this._BiddingReturnCostCode != null)
            {
                newRecord["BiddingReturnCostCode"] = this._BiddingReturnCostCode;
            }
            if (this._BiddingReturnCostID != null)
            {
                newRecord["BiddingReturnCostID"] = this._BiddingReturnCostID;
            }
            if (this._Cash != null)
            {
                newRecord["Cash"] = this._Cash;
            }
            if (this._MoneyType != null)
            {
                newRecord["MoneyType"] = this._MoneyType;
            }
            if (this._MoneyTypeID != null)
            {
                newRecord["MoneyTypeID"] = this._MoneyTypeID;
            }
            if (this._ExchangeRate != null)
            {
                newRecord["ExchangeRate"] = this._ExchangeRate;
            }
            if (flag)
            {
                biddingReturnCostByCode.AddNewRecord(newRecord);
            }
            return(biddingReturnCostByCode);
        }
Exemplo n.º 20
0
        private EntityData BuildData()
        {
            EntityData gradeConsiderDiathesisByCode;
            DataRow    newRecord;
            bool       flag = false;

            if (this._ConsiderDiathesisCode == "")
            {
                flag = true;
                gradeConsiderDiathesisByCode = this.GetGradeConsiderDiathesisByCode("");
                this._ConsiderDiathesisCode  = SystemManageDAO.GetNewSysCode("GradeConsiderDiathesis");
                newRecord = gradeConsiderDiathesisByCode.GetNewRecord();
            }
            else
            {
                gradeConsiderDiathesisByCode = this.GetGradeConsiderDiathesisByCode(this._ConsiderDiathesisCode);
                newRecord = gradeConsiderDiathesisByCode.CurrentRow;
            }
            if (this._ConsiderDiathesisCode != null)
            {
                newRecord["ConsiderDiathesisCode"] = this._ConsiderDiathesisCode;
            }
            if (this._MainDefineCode != null)
            {
                newRecord["MainDefineCode"] = this._MainDefineCode;
            }
            if (this._ParentCode != null)
            {
                newRecord["ParentCode"] = this._ParentCode;
            }
            if (this._ConsiderDiathesis != null)
            {
                newRecord["ConsiderDiathesis"] = this._ConsiderDiathesis;
            }
            if (this._GradeGuideline != null)
            {
                newRecord["GradeGuideline"] = this._GradeGuideline;
            }
            if (this._Percentage != null)
            {
                newRecord["Percentage"] = this._Percentage;
            }
            if (this._state != null)
            {
                newRecord["state"] = this._state;
            }
            if (flag)
            {
                gradeConsiderDiathesisByCode.AddNewRecord(newRecord);
            }
            return(gradeConsiderDiathesisByCode);
        }
Exemplo n.º 21
0
        public static DataRow CopySystemGroupNewRow(DataTable tb, DataRow drSrc, DataRow drDst, string dstClassCode)
        {
            DataRow row3;

            try
            {
                string text  = "";
                int    num   = 0;
                string text2 = "";
                if (drDst != null)
                {
                    text  = ConvertRule.ToString(drDst["GroupCode"]);
                    num   = ConvertRule.ToInt(drDst["Deep"]);
                    text2 = ConvertRule.ToString(drDst["FullID"]);
                }
                DataRow row       = tb.NewRow();
                int     num2      = num + 1;
                string  groupCode = SystemManageDAO.GetNewSysCode("SystemGroupCode");
                string  text4     = text2;
                if (text4.Length > 0)
                {
                    text4 = text4 + "-" + groupCode;
                }
                else
                {
                    text4 = groupCode;
                }
                row["GroupCode"]  = groupCode;
                row["GroupName"]  = drSrc["GroupName"];
                row["SortID"]     = drSrc["SortID"];
                row["ClassCode"]  = dstClassCode;
                row["deep"]       = num2;
                row["FullID"]     = text4;
                row["ParentCode"] = text;
                tb.Rows.Add(row);
                EntityData entity = ResourceDAO.GetAccessRangeByGroupCode(drSrc[0].ToString());
                DataTable  table  = entity.Tables["AccessRange"];
                for (int i = table.Rows.Count - 1; i >= 0; i--)
                {
                    DataRow row2 = table.Rows[i];
                    AccessRangeNewRow(table, row2["AccessRangeType"].ToString(), row2["RelationCode"].ToString(), row2["OperationCode"].ToString(), groupCode, row2["RoleLevel"].ToString(), row2["ResourceCode"].ToString());
                }
                ResourceDAO.SubmitAllAccessRange(entity);
                row3 = row;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(row3);
        }
Exemplo n.º 22
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="code"></param>
        /// <param name="parentCode"></param>
        private void SavaData()
        {
            try
            {
                string code = this.txtSystemID.Value;

                EntityData entity = DAL.EntityDAO.ConstructDAO.GetVisualProgressByCode(code);
                DataRow    dr;
                bool       isNew = !entity.HasRecord();


                if (isNew)
                {
                    dr = entity.GetNewRecord();

                    code = SystemManageDAO.GetNewSysCode("VisualProgressSystemID");
                    this.txtSystemID.Value = code;
                    dr["SystemID"]         = code;
                    entity.CurrentTable.Rows.Add(dr);
                }
                else
                {
                    dr = entity.CurrentRow;
                }

                dr["VisualProgress"] = this.txtVisualProgress.Value;
                dr["ProgressType"]   = this.sltProgressType.Value;
                dr["SortID"]         = BLL.ConvertRule.ToInt(this.txtSortID.Value);
                dr["InvestPercent"]  = BLL.ConvertRule.ToDecimal(this.txtInvestPercent.Value);

                if (this.rdoIsPoint0.Checked)
                {
                    dr["IsPoint"] = 0;
                }
                else
                {
                    dr["IsPoint"] = 1;
                }

                DAL.EntityDAO.ConstructDAO.SubmitAllVisualProgress(entity);

                entity.Dispose();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 23
0
        private EntityData BuildData()
        {
            EntityData oAComputerMaintenanceByCode;
            DataRow    newRecord;
            bool       flag = false;

            if (this._ComputerMaintenanceCode == "")
            {
                flag = true;
                oAComputerMaintenanceByCode   = this.GetOAComputerMaintenanceByCode("");
                this._ComputerMaintenanceCode = SystemManageDAO.GetNewSysCode("OAComputerMaintenance");
                newRecord = oAComputerMaintenanceByCode.GetNewRecord();
            }
            else
            {
                oAComputerMaintenanceByCode = this.GetOAComputerMaintenanceByCode(this._ComputerMaintenanceCode);
                newRecord = oAComputerMaintenanceByCode.CurrentRow;
            }
            if (this._ComputerMaintenanceCode != null)
            {
                newRecord["ComputerMaintenanceCode"] = this._ComputerMaintenanceCode;
            }
            if (this._Unit != null)
            {
                newRecord["Unit"] = this._Unit;
            }
            if (this._ApplyUser != null)
            {
                newRecord["ApplyUser"] = this._ApplyUser;
            }
            if (this._MaintenanceItem != null)
            {
                newRecord["MaintenanceItem"] = this._MaintenanceItem;
            }
            if (this._MaintenanceContext != null)
            {
                newRecord["MaintenanceContext"] = this._MaintenanceContext;
            }
            if (this._ConkOutText != null)
            {
                newRecord["ConkOutText"] = this._ConkOutText;
            }
            if (flag)
            {
                oAComputerMaintenanceByCode.AddNewRecord(newRecord);
            }
            return(oAComputerMaintenanceByCode);
        }
Exemplo n.º 24
0
        private EntityData BuildData(string UserCodes)
        {
            EntityData sendMsgByCode = this.GetSendMsgByCode("");

            foreach (string text in UserCodes.Split(new char[] { ',' }))
            {
                if (text != "")
                {
                    this._SendMsgCode = SystemManageDAO.GetNewSysCode("SendMsg");
                    DataRow newRecord = sendMsgByCode.GetNewRecord();
                    if (this._SendMsgCode != null)
                    {
                        newRecord["SendMsgCode"] = this._SendMsgCode;
                    }
                    if (this._SendUsercode != null)
                    {
                        newRecord["SendUsercode"] = this._SendUsercode;
                    }
                    newRecord["ToUsercode"] = text;
                    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;
                    }
                    sendMsgByCode.AddNewRecord(newRecord);
                }
            }
            return(sendMsgByCode);
        }
Exemplo n.º 25
0
        private void ModifyUser()
        {
            string Flag = Request["hFlag"] + "";
            string Code = Request["hCode"] + "";

            //检查是否与原有用户 重复
            if (CheckRepeatUser(Code))
            {
                if (Flag == "2")
                {
                    this.lblMaster.Text    = BLL.SystemRule.GetUserName(Code);
                    this.btnMaster.Value   = "更换责任人";
                    this.hMasterCode.Value = Code;
                }
                else if (Flag == "1")
                {
                    this.lblMonitor.Text    = BLL.SystemRule.GetUserName(Code);
                    this.btnMonitor.Value   = " 更换监督人";
                    this.hMonitorCode.Value = Code;
                }
                else if (Flag == "0")
                {
                    DataTable dtUser = ((DataTable)Session["UserList"]).Copy();
                    DataRow   dr;
                    string[]  strUserList = Code.Split(',');
                    for (int i = 0; i < strUserList.Length; i++)
                    {
                        dr = dtUser.NewRow();
                        dr["TaskPersonCode"] = SystemManageDAO.GetNewSysCode("TaskPersonCode");
                        dr["UserName"]       = BLL.SystemRule.GetUserName(strUserList[i]);
                        dr["UserCode"]       = strUserList[i];
                        dtUser.Rows.Add(dr);
                    }
                    this.dgUserList.DataSource = dtUser;
                    this.dgUserList.DataBind();
                    Session["UserList"] = dtUser;
                }
            }
            else
            {
                Response.Write(JavaScript.ScriptStart);
                Response.Write("alert('与原有值重复!');");
                Response.Write(JavaScript.ScriptEnd);
            }
            this.hFlag.Value = "";
            this.hCode.Value = "";
        }
Exemplo n.º 26
0
 public void Insert(IncomeBugetModel ibModel)
 {
     if (string.IsNullOrEmpty(ibModel.ID))
     {
         if (!string.IsNullOrEmpty(ibModel.Money.ToString()))
         {
             string     format     = "INSERT INTO RptFinIn(SYSTEMID,VERID,IYEAR,IMONTH,MONEY,PROJECTCODE) VALUES('{0}',1,{1},{2},{3},'{4}')";
             string     newSysCode = SystemManageDAO.GetNewSysCode("RptFinIn");
             QueryAgent agent      = new QueryAgent();
             agent.ExecuteSql(string.Format(format, new object[] { newSysCode, ibModel.Year, ibModel.Month, ibModel.Money * 10000M, ibModel.ProjectCode }));
             agent.Dispose();
         }
     }
     else
     {
         this.UpDate(ibModel);
     }
 }
Exemplo n.º 27
0
        private EntityData BuildData()
        {
            EntityData oACachetByCode;
            DataRow    newRecord;
            bool       flag = false;

            if (this._OACachetCode == "")
            {
                flag               = true;
                oACachetByCode     = this.GetOACachetByCode("");
                this._OACachetCode = SystemManageDAO.GetNewSysCode("OACachet");
                newRecord          = oACachetByCode.GetNewRecord();
            }
            else
            {
                oACachetByCode = this.GetOACachetByCode(this._OACachetCode);
                newRecord      = oACachetByCode.CurrentRow;
            }
            if (this._OACachetCode != null)
            {
                newRecord["OACachetCode"] = this._OACachetCode;
            }
            if (this._Unit != null)
            {
                newRecord["Unit"] = this._Unit;
            }
            if (this._ApplyDate != null)
            {
                newRecord["ApplyDate"] = this._ApplyDate;
            }
            if (this._Reason != null)
            {
                newRecord["Reason"] = this._Reason;
            }
            if (this._ApplyUser != null)
            {
                newRecord["ApplyUser"] = this._ApplyUser;
            }
            if (flag)
            {
                oACachetByCode.AddNewRecord(newRecord);
            }
            return(oACachetByCode);
        }
Exemplo n.º 28
0
        private EntityData BuildData()
        {
            EntityData gradeDepartmentByCode;
            DataRow    newRecord;
            bool       flag = false;

            if (this._DepartmentDefineCode == "")
            {
                flag = true;
                gradeDepartmentByCode      = this.GetGradeDepartmentByCode("");
                this._DepartmentDefineCode = SystemManageDAO.GetNewSysCode("GradeDepartment");
                newRecord = gradeDepartmentByCode.GetNewRecord();
            }
            else
            {
                gradeDepartmentByCode = this.GetGradeDepartmentByCode(this._DepartmentDefineCode);
                newRecord             = gradeDepartmentByCode.CurrentRow;
            }
            if (this._DepartmentDefineCode != null)
            {
                newRecord["DepartmentDefineCode"] = this._DepartmentDefineCode;
            }
            if (this._MainDefineCode != null)
            {
                newRecord["MainDefineCode"] = this._MainDefineCode;
            }
            if (this._DepartmentName != null)
            {
                newRecord["DepartmentName"] = this._DepartmentName;
            }
            if (this._AdjustCoefficient != null)
            {
                newRecord["AdjustCoefficient"] = this._AdjustCoefficient;
            }
            if (this._Percentage != null)
            {
                newRecord["Percentage"] = this._Percentage;
            }
            if (flag)
            {
                gradeDepartmentByCode.AddNewRecord(newRecord);
            }
            return(gradeDepartmentByCode);
        }
Exemplo n.º 29
0
        public bool CopyAttachment(string oldMastCode, string newMasterCode, string AttachmentType)
        {
            EntityData entity = DAOFactory.GetAttachmentDAO().GetAttachMentByMasterCode(AttachmentType, oldMastCode);

            if (!entity.HasRecord())
            {
                return(false);
            }
            DataRow drSrc = entity.CurrentRow;
            DataRow row   = entity.GetNewRecord();

            entity.CurrentTable.Rows.Add(row);
            ConvertRule.DataRowCopy(drSrc, row, entity.CurrentTable, entity.CurrentTable);
            row["AttachmentCode"] = SystemManageDAO.GetNewSysCode("AttachMentCode");
            row["MasterCode"]     = newMasterCode;
            DAOFactory.GetAttachmentDAO().SubmitAllAttachMent(entity);
            entity.Dispose();
            return(true);
        }
Exemplo n.º 30
0
        public bool AddOrUpdateAttachment(string code, string userCode, string fileName, string contentType, int length, string strAttachMentType, string strMasterCode, Stream fileStream)
        {
            EntityData entity    = DAOFactory.GetAttachmentDAO().GetAttachMentByCode(code);
            DataRow    newRecord = null;

            if (!entity.HasRecord())
            {
                newRecord = entity.GetNewRecord();
                newRecord["AttachMentCode"] = SystemManageDAO.GetNewSysCode("AttachMentCode");
                newRecord["AttachMentType"] = strAttachMentType;
                newRecord["MasterCode"]     = strMasterCode;
                entity.AddNewRecord(newRecord);
            }
            else
            {
                newRecord = entity.CurrentRow;
            }
            Stream stream = fileStream;

            byte[] buffer = new byte[length];
            int    num    = stream.Read(buffer, 0, length);

            newRecord["FileName"]     = fileName;
            newRecord["CreatePerson"] = userCode;
            newRecord["CreateDate"]   = DateTime.Now;
            newRecord["Content_Type"] = contentType;
            newRecord["Length"]       = length;
            if (_SaveMode == AttachmentSaveMode.database)
            {
                newRecord["Content"]  = buffer;
                newRecord["GuidName"] = null;
            }
            else
            {
                string guidname = Guid.NewGuid().ToString();
                newRecord["GuidName"] = guidname;
                newRecord["Content"]  = DBNull.Value;
                SaveFile(length, buffer, guidname, newRecord["CreateDate"].ToString());
            }
            DAOFactory.GetAttachmentDAO().SubmitAllAttachMent(entity);
            entity.Dispose();
            return(true);
        }