예제 #1
0
        public void Update(HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_T businessObject, HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_TKeys businessObjectKey)
        {
            try
            {
                if (businessObject.LadeAssignmentCancelRequestCommentID_int == businessObjectKey.LadeAssignmentCancelRequestCommentID_int)
                {
                    if (businessObject.IsValid(Hepsa.Core.Validation.ValidationExceptionType.Except, "UniqueLadeAssignmentCancelRequestCommentID_int") == false)
                    {
                        throw new Hepsa.Core.Validation.InvalidBusinessObjectException(businessObject.BrokenRulesList().ToString());
                    }
                }
                else
                {
                    if (businessObject.IsValid() == false)
                    {
                        throw new Hepsa.Core.Validation.InvalidBusinessObjectException(businessObject.BrokenRulesList().ToString());
                    }
                }

                _dataObject.Update(businessObject, businessObjectKey);
            }
            catch (System.Exception ex)
            {
                throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
            }
        }
예제 #2
0
 public void PopulateBusinessObjectFromReader(HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_T businessObject, IDataReader dataReader)
 {
     businessObject.LadeAssignmentCancelRequestCommentID_int = dataReader.GetInt32(dataReader.GetOrdinal(HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_T.LadeAssignmentCancelRequestComment_TField.LadeAssignmentCancelRequestCommentID_int.ToString()));
     businessObject.LadeAssignmentCancelRequestID_int        = dataReader.GetInt32(dataReader.GetOrdinal(HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_T.LadeAssignmentCancelRequestComment_TField.LadeAssignmentCancelRequestID_int.ToString()));
     businessObject.LadeCancelCommentID_int = dataReader.GetInt32(dataReader.GetOrdinal(HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_T.LadeAssignmentCancelRequestComment_TField.LadeCancelCommentID_int.ToString()));
     businessObject.LadeCancelComment_nvc   = dataReader.GetString(dataReader.GetOrdinal(HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_T.LadeAssignmentCancelRequestComment_TField.LadeCancelComment_nvc.ToString()));
     businessObject.Date_nvc     = dataReader.GetString(dataReader.GetOrdinal(HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_T.LadeAssignmentCancelRequestComment_TField.Date_nvc.ToString()));
     businessObject.Time_nvc     = dataReader.GetString(dataReader.GetOrdinal(HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_T.LadeAssignmentCancelRequestComment_TField.Time_nvc.ToString()));
     businessObject.UserName_nvc = dataReader.GetString(dataReader.GetOrdinal(HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_T.LadeAssignmentCancelRequestComment_TField.UserName_nvc.ToString()));
 }
예제 #3
0
        protected override void Insert()
        {
            HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_TFactory LadeAssignmentCacelRequestFactory = new HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_TFactory();
            try
            {
                HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_T LadeAssignmentCacelRequestEntity = new HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_T();
                LadeAssignmentCacelRequestEntity.ResuestDate_nvc       = Hepsa.Core.Common.PersentationController.GetMaskedTextBoxValue(RequestDate_nvcTextBox);  //GetEntityValue(ResuestDate_nvcTextBox.Text, TypeCode.String).ToString();
                LadeAssignmentCacelRequestEntity.RequestTime_nvc       = Hepsa.Core.Common.PersentationController.GetMaskedTextBoxValue(RequestTime_nvcTextBox);  //GetEntityValue(RequestTime_nvcTextBox.Text, TypeCode.String).ToString();
                LadeAssignmentCacelRequestEntity.RequestUserName_nvc   = (String)Hepsa.Core.Common.PersentationController.GetEntityValue(RequestUserName_nvcComboBox.SelectedValue, TypeCode.String);
                LadeAssignmentCacelRequestEntity.AcceptedDate_nvc      = Hepsa.Core.Common.PersentationController.GetMaskedTextBoxValue(AcceptedDate_nvcTextBox); //GetEntityValue(AcceptedDate_nvcTextBox.Text, TypeCode.String).ToString();
                LadeAssignmentCacelRequestEntity.AcceptedTime_nvc      = Hepsa.Core.Common.PersentationController.GetMaskedTextBoxValue(AcceptedTime_nvcTextBox); //GetEntityValue(AcceptedTime_nvcTextBox.Text, TypeCode.String).ToString();
                LadeAssignmentCacelRequestEntity.AcceptedUserName_nvc  = (String)Hepsa.Core.Common.PersentationController.GetEntityValue(AcceptedUserName_nvcComboBox.SelectedValue, TypeCode.String);
                LadeAssignmentCacelRequestEntity.Comment_nvc           = Hepsa.Core.Common.PersentationController.GetEntityValue(Comment_nvcTextBox.Text, TypeCode.String).ToString();
                LadeAssignmentCacelRequestEntity.LadeAssignmentID_bint = (Int64)_LadeAssignmentKey.LadeAssignmentID_bint;
                LadeAssignmentCacelRequestFactory.BeginProc();
                LadeAssignmentCacelRequestFactory.Insert(LadeAssignmentCacelRequestEntity);

                HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_TFactory LadeAssignmentCancelCommentFactory = new HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_TFactory();
                //////////////////////////////
                for (int i = 0; i < LadeCancelCommentID_intCheckList.CheckedItems.Count; i++)
                {
                    HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_T LadeAssignmentCancelCommentEntity = new HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_T();
                    LadeAssignmentCancelCommentEntity.LadeAssignmentCancelRequestID_int = LadeAssignmentCacelRequestEntity.LadeAssignmentCancelRequestID_int;
                    LadeAssignmentCancelCommentEntity.LadeCancelCommentID_int           = (Int32)((HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T) this.LadeCancelCommentID_intCheckList.CheckedItems[i]).LadeCanceltCommentID_int;
                    LadeAssignmentCancelCommentEntity.LadeCancelComment_nvc             = ((HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T) this.LadeCancelCommentID_intCheckList.CheckedItems[i]).LadeCancelComment_nvc;
                    LadeAssignmentCancelCommentEntity.Date_nvc     = LadeAssignmentCancelCommentFactory.ServerJalaliDate;
                    LadeAssignmentCancelCommentEntity.Time_nvc     = LadeAssignmentCancelCommentFactory.ServerTime;
                    LadeAssignmentCancelCommentEntity.UserName_nvc = HPS.Common.CurrentUser.user.UserName_nvc;

                    LadeAssignmentCancelCommentFactory.Insert(LadeAssignmentCancelCommentEntity);
                }

                /////////////////////////////


                LadeAssignmentCacelRequestFactory.CommitProc();
                if (DataTable != null)
                {
                    DataRow dr = this.DataTable.NewRow();
                    dr[HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_T.LadeAssignmentCacelRequest_TField.LadeAssignmentCancelRequestID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LadeAssignmentCacelRequestEntity.LadeAssignmentCancelRequestID_int, TypeCode.Int32);
                    dr[HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_T.LadeAssignmentCacelRequest_TField.ResuestDate_nvc.ToString()]     = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LadeAssignmentCacelRequestEntity.ResuestDate_nvc, TypeCode.String);
                    dr[HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_T.LadeAssignmentCacelRequest_TField.RequestTime_nvc.ToString()]     = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LadeAssignmentCacelRequestEntity.RequestTime_nvc, TypeCode.String);
                    dr[HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_T.LadeAssignmentCacelRequest_TField.RequestUserName_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LadeAssignmentCacelRequestEntity.RequestUserName_nvc, TypeCode.String);
                    dr["RequestUserName_nvcUserName_nvc"] = Hepsa.Core.Common.PersentationController.GetComboBoxDisplayMember(RequestUserName_nvcComboBox);
                    dr[HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_T.LadeAssignmentCacelRequest_TField.AcceptedDate_nvc.ToString()]     = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LadeAssignmentCacelRequestEntity.AcceptedDate_nvc, TypeCode.String);
                    dr[HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_T.LadeAssignmentCacelRequest_TField.AcceptedTime_nvc.ToString()]     = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LadeAssignmentCacelRequestEntity.AcceptedTime_nvc, TypeCode.String);
                    dr[HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_T.LadeAssignmentCacelRequest_TField.AcceptedUserName_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LadeAssignmentCacelRequestEntity.AcceptedUserName_nvc, TypeCode.String);
                    dr["AcceptedUserName_nvcUserName_nvc"] = Hepsa.Core.Common.PersentationController.GetComboBoxDisplayMember(AcceptedUserName_nvcComboBox);
                    dr[HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_T.LadeAssignmentCacelRequest_TField.Comment_nvc.ToString()]           = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LadeAssignmentCacelRequestEntity.Comment_nvc, TypeCode.String);
                    dr[HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_T.LadeAssignmentCacelRequest_TField.LadeAssignmentID_bint.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LadeAssignmentCacelRequestEntity.LadeAssignmentID_bint, TypeCode.Int64);

                    DataTable.Rows.Add(dr);
                    DataTable.AcceptChanges();
                }
                this.ClearForm(this);
            }
            catch (Exception ex)
            {
                LadeAssignmentCacelRequestFactory.RollBackProc();
                throw ex;
            }
        }
예제 #4
0
        protected override void Edit()
        {
            HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_TFactory LadeAssignmentCacelRequestFactory = new HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_TFactory();
            try
            {
                HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_T LadeAssignmentCacelRequestEntity = new HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_T();
                LadeAssignmentCacelRequestEntity.ResuestDate_nvc       = Hepsa.Core.Common.PersentationController.GetMaskedTextBoxValue(RequestDate_nvcTextBox);  //GetEntityValue(ResuestDate_nvcTextBox.Text, TypeCode.String).ToString();
                LadeAssignmentCacelRequestEntity.RequestTime_nvc       = Hepsa.Core.Common.PersentationController.GetMaskedTextBoxValue(RequestTime_nvcTextBox);  //GetEntityValue(RequestTime_nvcTextBox.Text, TypeCode.String).ToString();
                LadeAssignmentCacelRequestEntity.RequestUserName_nvc   = (String)Hepsa.Core.Common.PersentationController.GetEntityValue(RequestUserName_nvcComboBox.SelectedValue, TypeCode.String);
                LadeAssignmentCacelRequestEntity.AcceptedDate_nvc      = Hepsa.Core.Common.PersentationController.GetMaskedTextBoxValue(AcceptedDate_nvcTextBox); //.GetEntityValue(AcceptedDate_nvcTextBox.Text, TypeCode.String).ToString();
                LadeAssignmentCacelRequestEntity.AcceptedTime_nvc      = Hepsa.Core.Common.PersentationController.GetMaskedTextBoxValue(AcceptedTime_nvcTextBox); //.GetEntityValue(AcceptedTime_nvcTextBox.Text, TypeCode.String).ToString();
                LadeAssignmentCacelRequestEntity.AcceptedUserName_nvc  = (String)Hepsa.Core.Common.PersentationController.GetEntityValue(AcceptedUserName_nvcComboBox.SelectedValue, TypeCode.String);
                LadeAssignmentCacelRequestEntity.Comment_nvc           = Hepsa.Core.Common.PersentationController.GetEntityValue(Comment_nvcTextBox.Text, TypeCode.String).ToString();
                LadeAssignmentCacelRequestEntity.LadeAssignmentID_bint = (Int64)_LadeAssignmentKey.LadeAssignmentID_bint;
                if (LadeAssignmentCacelRequestEntity.AcceptedDate_nvc.CompareTo(LadeAssignmentCacelRequestFactory.ServerJalaliDate) < 0)
                {
                    throw new ApplicationException("تاریخ قبول درخواست نمی تواند قبل از تاریخ امروز باشد");
                }

                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.EditMessage) == true)
                {
                    LadeAssignmentCacelRequestFactory.BeginProc();
                    LadeAssignmentCacelRequestFactory.Update(LadeAssignmentCacelRequestEntity, (HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_TKeys)Key);

                    HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_TFactory LadeAssignmentCancelCommentFactory = new HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_TFactory();
                    //////////////////////////////
                    for (int i = 0; i < LadeCancelCommentID_intCheckList.CheckedItems.Count; i++)
                    {
                        HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_T LadeAssignmentCancelCommentEntity = new HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_T();
                        HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_T LACacelRequestEntity = new HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_T();

                        LACacelRequestEntity = LadeAssignmentCacelRequestFactory.GetBy((HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_TKeys)Key);
                        LadeAssignmentCancelCommentEntity.LadeAssignmentCancelRequestID_int = LACacelRequestEntity.LadeAssignmentCancelRequestID_int;
                        LadeAssignmentCancelCommentEntity.LadeCancelCommentID_int           = (Int32)((HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T) this.LadeCancelCommentID_intCheckList.CheckedItems[i]).LadeCanceltCommentID_int;
                        LadeAssignmentCancelCommentEntity.LadeCancelComment_nvc             = ((HPS.BLL.LadeCancelCommentBLL.BLLLadeCancelComment_T) this.LadeCancelCommentID_intCheckList.CheckedItems[i]).LadeCancelComment_nvc;
                        LadeAssignmentCancelCommentEntity.Date_nvc     = LadeAssignmentCancelCommentFactory.ServerJalaliDate;
                        LadeAssignmentCancelCommentEntity.Time_nvc     = LadeAssignmentCancelCommentFactory.ServerTime;
                        LadeAssignmentCancelCommentEntity.UserName_nvc = HPS.Common.CurrentUser.user.UserName_nvc;

                        LadeAssignmentCancelCommentFactory.Insert(LadeAssignmentCancelCommentEntity);
                    }

                    /////////////////////////////


                    LadeAssignmentCacelRequestFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_T.LadeAssignmentCacelRequest_TField.LadeAssignmentCancelRequestID_int.ToString() + "='" + ((HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_TKeys)Key).LadeAssignmentCancelRequestID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0][HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_T.LadeAssignmentCacelRequest_TField.ResuestDate_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LadeAssignmentCacelRequestEntity.ResuestDate_nvc, TypeCode.String);
                            dr[0][HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_T.LadeAssignmentCacelRequest_TField.RequestTime_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LadeAssignmentCacelRequestEntity.RequestTime_nvc, TypeCode.String);
                            dr[0]["RequestUserName_nvcUserName_nvc"] = Hepsa.Core.Common.PersentationController.GetComboBoxDisplayMember(RequestUserName_nvcComboBox);
                            dr[0][HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_T.LadeAssignmentCacelRequest_TField.AcceptedDate_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LadeAssignmentCacelRequestEntity.AcceptedDate_nvc, TypeCode.String);
                            dr[0][HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_T.LadeAssignmentCacelRequest_TField.AcceptedTime_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LadeAssignmentCacelRequestEntity.AcceptedTime_nvc, TypeCode.String);
                            dr[0]["AcceptedUserName_nvcUserName_nvc"] = Hepsa.Core.Common.PersentationController.GetComboBoxDisplayMember(AcceptedUserName_nvcComboBox);
                            dr[0][HPS.BLL.LadeAssignmentCacelRequestBLL.BLLLadeAssignmentCacelRequest_T.LadeAssignmentCacelRequest_TField.Comment_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LadeAssignmentCacelRequestEntity.Comment_nvc, TypeCode.String);
                        }
                        DataTable.AcceptChanges();
                    }
                }
            }
            catch (Exception ex)
            {
                LadeAssignmentCacelRequestFactory.RollBackProc();
                throw ex;
            }
        }
예제 #5
0
        public List <HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_T> PopulateObjectsFromReader(IDataReader dataReader)
        {
            List <HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_T> list = new List <HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_T>();

            while (dataReader.Read())
            {
                HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_T businessObject = new HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_T();
                PopulateBusinessObjectFromReader(businessObject, dataReader);
                list.Add(businessObject);
            }
            return(list);
        }
예제 #6
0
        public HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_T SelectByPrimaryKey(HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_TKeys businessObjectKey)
        {
            bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open);

            this.Command.CommandText = "[sp_LadeAssignmentCancelRequestComment_T_SelectByPrimaryKey]";
            this.Command.CommandType = CommandType.StoredProcedure;

            try{
                this.Command.Parameters.Clear();

                SqlParameter LadeAssignmentCancelRequestCommentID_int = new SqlParameter();
                LadeAssignmentCancelRequestCommentID_int.ParameterName = "@LadeAssignmentCancelRequestCommentID_int";
                LadeAssignmentCancelRequestCommentID_int.SqlDbType     = SqlDbType.Int;
                LadeAssignmentCancelRequestCommentID_int.Direction     = ParameterDirection.Input;
                LadeAssignmentCancelRequestCommentID_int.IsNullable    = false;
                LadeAssignmentCancelRequestCommentID_int.Value         = businessObjectKey.LadeAssignmentCancelRequestCommentID_int;
                this.Command.Parameters.Add(LadeAssignmentCancelRequestCommentID_int);



                if (ControlConnection)
                {
                    this.BeginTransaction();
                }

                IDataReader dataReader = this.Command.ExecuteReader();
                HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_T businessObject = new HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_T();
                if (dataReader.Read())
                {
                    PopulateBusinessObjectFromReader(businessObject, dataReader);
                }
                else
                {
                    businessObject = null;
                }

                if (dataReader.IsClosed == false)
                {
                    dataReader.Close();
                }


                if (ControlConnection)
                {
                    this.Commit();
                }
                return(businessObject);
            }
            catch (System.Exception ex) {
                if (ControlConnection)
                {
                    this.RollBack();
                }
                throw ex;
            }
        }
예제 #7
0
        public void Insert(HPS.BLL.LadeAssignmentCancelRequestCommentBLL.BLLLadeAssignmentCancelRequestComment_T businessObject)
        {
            bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open);

            this.Command.CommandText = "[sp_LadeAssignmentCancelRequestComment_T_Add]";
            this.Command.CommandType = CommandType.StoredProcedure;

            try{
                this.Command.Parameters.Clear();

                SqlParameter LadeAssignmentCancelRequestCommentID_int = new SqlParameter();
                LadeAssignmentCancelRequestCommentID_int.ParameterName = "@LadeAssignmentCancelRequestCommentID_int";
                LadeAssignmentCancelRequestCommentID_int.SqlDbType     = SqlDbType.Int;
                LadeAssignmentCancelRequestCommentID_int.Direction     = ParameterDirection.Output;
                LadeAssignmentCancelRequestCommentID_int.IsNullable    = false;
                LadeAssignmentCancelRequestCommentID_int.Value         = businessObject.LadeAssignmentCancelRequestCommentID_int;
                this.Command.Parameters.Add(LadeAssignmentCancelRequestCommentID_int);

                SqlParameter LadeAssignmentCancelRequestID_int = new SqlParameter();
                LadeAssignmentCancelRequestID_int.ParameterName = "@LadeAssignmentCancelRequestID_int";
                LadeAssignmentCancelRequestID_int.SqlDbType     = SqlDbType.Int;
                LadeAssignmentCancelRequestID_int.Direction     = ParameterDirection.Input;
                LadeAssignmentCancelRequestID_int.IsNullable    = false;
                LadeAssignmentCancelRequestID_int.Value         = businessObject.LadeAssignmentCancelRequestID_int;
                this.Command.Parameters.Add(LadeAssignmentCancelRequestID_int);

                SqlParameter LadeCancelCommentID_int = new SqlParameter();
                LadeCancelCommentID_int.ParameterName = "@LadeCancelCommentID_int";
                LadeCancelCommentID_int.SqlDbType     = SqlDbType.Int;
                LadeCancelCommentID_int.Direction     = ParameterDirection.Input;
                LadeCancelCommentID_int.IsNullable    = false;
                LadeCancelCommentID_int.Value         = businessObject.LadeCancelCommentID_int;
                this.Command.Parameters.Add(LadeCancelCommentID_int);

                SqlParameter LadeCancelComment_nvc = new SqlParameter();
                LadeCancelComment_nvc.ParameterName = "@LadeCancelComment_nvc";
                LadeCancelComment_nvc.SqlDbType     = SqlDbType.NVarChar;
                LadeCancelComment_nvc.Direction     = ParameterDirection.Input;
                LadeCancelComment_nvc.IsNullable    = false;
                LadeCancelComment_nvc.Value         = businessObject.LadeCancelComment_nvc;
                this.Command.Parameters.Add(LadeCancelComment_nvc);

                SqlParameter Date_nvc = new SqlParameter();
                Date_nvc.ParameterName = "@Date_nvc";
                Date_nvc.SqlDbType     = SqlDbType.NVarChar;
                Date_nvc.Direction     = ParameterDirection.Input;
                Date_nvc.IsNullable    = false;
                Date_nvc.Value         = businessObject.Date_nvc;
                this.Command.Parameters.Add(Date_nvc);

                SqlParameter Time_nvc = new SqlParameter();
                Time_nvc.ParameterName = "@Time_nvc";
                Time_nvc.SqlDbType     = SqlDbType.NVarChar;
                Time_nvc.Direction     = ParameterDirection.Input;
                Time_nvc.IsNullable    = false;
                Time_nvc.Value         = businessObject.Time_nvc;
                this.Command.Parameters.Add(Time_nvc);

                SqlParameter UserName_nvc = new SqlParameter();
                UserName_nvc.ParameterName = "@UserName_nvc";
                UserName_nvc.SqlDbType     = SqlDbType.NVarChar;
                UserName_nvc.Direction     = ParameterDirection.Input;
                UserName_nvc.IsNullable    = false;
                UserName_nvc.Value         = businessObject.UserName_nvc;
                this.Command.Parameters.Add(UserName_nvc);



                if (ControlConnection)
                {
                    this.BeginTransaction();
                }

                this.Command.ExecuteNonQuery();

                businessObject.LadeAssignmentCancelRequestCommentID_int = (Int32)(this.Command.Parameters["@LadeAssignmentCancelRequestCommentID_int"].Value);

                if (ControlConnection)
                {
                    this.Commit();
                }
            }
            catch (System.Exception ex) {
                if (ControlConnection)
                {
                    this.RollBack();
                }
                throw ex;
            }
        }