示例#1
0
        public void InsertReasonCode(tmdlreasoncode reasoncode, List<tmdlreasoncodestep> lstReasonCodeStep,
            List<tsysattributevalue> lstAttribute)
        {
            try
            {
                dbInstance.BeginTransaction();

                //Insert reason code
                localDal.DoInsert<tmdlreasoncode>(reasoncode);

                //insert reason code step
                for (int i = 0; i < lstReasonCodeStep.Count; i++)
                {
                    localDal.DoInsert<tmdlreasoncodestep>(lstReasonCodeStep[i]);
                }

                //Insert attribute
                for (int i = 0; i < lstAttribute.Count; i++)
                {
                    localDal.DoInsert<tsysattributevalue>(lstAttribute[i]);
                }

                dbInstance.Commit();
            }
            catch (Exception ex)
            {
                dbInstance.Rollback();
                throw ex;
            }
            finally
            {
                dbInstance.CloseConnection();
            }
        }
示例#2
0
 public void DoUpdateReasonCode(ContextInfo contextInfo, tmdlreasoncode reasoncode,
     List<tmdlreasoncodestep> lstReasonCodeStep, List<tsysattributevalue> lstAttribute)
 {
     contextInfo.Action = MES_ActionType.Update;
     ReasonCodeBll bll = new ReasonCodeBll(contextInfo);
     bll.CallAccessControl();
     bll.UpdateReasonCode(reasoncode,lstReasonCodeStep, lstAttribute);
     GC.Collect();
 }
示例#3
0
 /// <summary>
 /// Create a new tmdlreasoncode object.
 /// </summary>
 /// <param name="reasoncode">Initial value of the reasoncode property.</param>
 /// <param name="reasoncategory">Initial value of the reasoncategory property.</param>
 /// <param name="lastmodifieduser">Initial value of the lastmodifieduser property.</param>
 /// <param name="lastmodifiedtime">Initial value of the lastmodifiedtime property.</param>
 public static tmdlreasoncode Createtmdlreasoncode(global::System.String reasoncode, global::System.String reasoncategory, global::System.String lastmodifieduser, global::System.DateTime lastmodifiedtime)
 {
     tmdlreasoncode tmdlreasoncode = new tmdlreasoncode();
     tmdlreasoncode.reasoncode = reasoncode;
     tmdlreasoncode.reasoncategory = reasoncategory;
     tmdlreasoncode.lastmodifieduser = lastmodifieduser;
     tmdlreasoncode.lastmodifiedtime = lastmodifiedtime;
     return tmdlreasoncode;
 }
示例#4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the tmdlreasoncode EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTotmdlreasoncode(tmdlreasoncode tmdlreasoncode)
 {
     base.AddObject("tmdlreasoncode", tmdlreasoncode);
 }
示例#5
0
        public void UpdateReasonCode(tmdlreasoncode reasoncode, List<tmdlreasoncodestep> lstReasonCodeStep,
            List<tsysattributevalue> lstAttribute)
        {
            try
            {
                dbInstance.BeginTransaction();

                List<MESParameterInfo> lstParameters = new List<MESParameterInfo>()
                {
                    new MESParameterInfo(){
                        ParamName="attributeid",
                        ParamValue=reasoncode.attributeid,
                        ParamType="string"
                    }
                };
                //delete attribute
                localDal.DoDelete<tsysattributevalue>(lstParameters);
                //delete reason code step
                lstParameters = new List<MESParameterInfo>()
                {
                    new MESParameterInfo(){
                        ParamName="reasoncode",
                        ParamValue=reasoncode.reasoncode,
                        ParamType="string"
                    }
                };
                localDal.DoDelete<tmdlreasoncodestep>(lstParameters);

                //Insert reason code
                localDal.DoUpdate<tmdlreasoncode>(reasoncode);

                //insert reason code step
                for (int i = 0; i < lstReasonCodeStep.Count; i++)
                {
                    localDal.DoInsert<tmdlreasoncodestep>(lstReasonCodeStep[i]);
                }

                //Insert attribute
                for (int i = 0; i < lstAttribute.Count; i++)
                {
                    localDal.DoInsert<tsysattributevalue>(lstAttribute[i]);
                }

                dbInstance.Commit();
            }
            catch (Exception ex)
            {
                dbInstance.Rollback();
                throw ex;
            }
            finally
            {
                dbInstance.CloseConnection();
            }
        }