Example #1
0
        public void InsertAttributeTemplate(tsysattrtplate template, List<tsysattrtplatedtl> lstAttribute)
        {
            try
            {
                dbInstance.BeginTransaction();

                //Insert header
                localDal.DoInsert<tsysattrtplate>(template);

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

                dbInstance.Commit();
            }
            catch (Exception ex)
            {
                dbInstance.Rollback();
                throw ex;
            }
            finally
            {
                dbInstance.CloseConnection();
            }
        }
Example #2
0
 /// <summary>
 /// Create a new tsysattrtplate object.
 /// </summary>
 /// <param name="attrtplatid">Initial value of the attrtplatid property.</param>
 /// <param name="attrtplatname">Initial value of the attrtplatname property.</param>
 /// <param name="lastmodifieduser">Initial value of the lastmodifieduser property.</param>
 /// <param name="lastmodifiedtime">Initial value of the lastmodifiedtime property.</param>
 public static tsysattrtplate Createtsysattrtplate(global::System.String attrtplatid, global::System.String attrtplatname, global::System.String lastmodifieduser, global::System.DateTime lastmodifiedtime)
 {
     tsysattrtplate tsysattrtplate = new tsysattrtplate();
     tsysattrtplate.attrtplatid = attrtplatid;
     tsysattrtplate.attrtplatname = attrtplatname;
     tsysattrtplate.lastmodifieduser = lastmodifieduser;
     tsysattrtplate.lastmodifiedtime = lastmodifiedtime;
     return tsysattrtplate;
 }
Example #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the tsysattrtplate EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTotsysattrtplate(tsysattrtplate tsysattrtplate)
 {
     base.AddObject("tsysattrtplate", tsysattrtplate);
 }
Example #4
0
        public void UpdateAttributeTemplate(tsysattrtplate template, List<tsysattrtplatedtl> lstAttribute)
        {
            try
            {
                dbInstance.BeginTransaction();

                List<MESParameterInfo> lstParameters = new List<MESParameterInfo>()
                {
                    new MESParameterInfo(){
                        ParamName="attrtplatid",
                        ParamValue=template.attrtplatid,
                        ParamType="string"
                    }
                };
                //delete detail first
                localDal.DoDelete<tsysattrtplatedtl>(lstParameters);

                //Insert header
                localDal.DoUpdate<tsysattrtplate>(template);

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

                dbInstance.Commit();
            }
            catch (Exception ex)
            {
                dbInstance.Rollback();
                throw ex;
            }
            finally
            {
                dbInstance.CloseConnection();
            }
        }
Example #5
0
 public void UpdateAttributeTemplate(ContextInfo contextInfo,tsysattrtplate template,List<tsysattrtplatedtl> lstAttribute)
 {
     contextInfo.Action = MES_ActionType.Update;
     AttributeTemplateBll bll = new AttributeTemplateBll(contextInfo);
     bll.CallAccessControl();
     bll.UpdateAttributeTemplate(template, lstAttribute);
     GC.Collect();
 }