Example #1
0
        protected override void Edit()
        {
            HPS.BLL.SaloonBLL.BLLSaloon_TFactory SaloonFactory = new HPS.BLL.SaloonBLL.BLLSaloon_TFactory();
            try
            {
                HPS.BLL.SaloonBLL.BLLSaloon_T SaloonEntity = new HPS.BLL.SaloonBLL.BLLSaloon_T();
                SaloonEntity.SaloonID_int = ((HPS.BLL.SaloonBLL.BLLSaloon_TKeys)Key).SaloonID_int;
                SaloonEntity.Saloon_nvc   = Hepsa.Core.Common.PersentationController.GetEntityValue(Saloon_nvcTextBox.Text, TypeCode.String).ToString();
                SaloonEntity.TurnDistinictAfterCredit_int     = (Int32?)Hepsa.Core.Common.PersentationController.GetEntityValue(TurnDistinictAfterCredit_intNumericTextBox.NumericText, TypeCode.Int32);
                SaloonEntity.TurnNumberInLadeAnnouncement_int = (Int32?)Hepsa.Core.Common.PersentationController.GetEntityValue(TurnNumberInLadeAnnouncement_intNumericTextBox.NumericText, TypeCode.Int32);


                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.EditMessage) == true)
                {
                    SaloonFactory.BeginProc();
                    SaloonFactory.Update(SaloonEntity, (HPS.BLL.SaloonBLL.BLLSaloon_TKeys)Key);
                    HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory();
                    HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys    LaderTypeKey     = new HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys();
                    foreach (HPS.BLL.LaderTypeBLL.BLLLaderType_T item in LaderTypeFactory.GetAllBy(BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.SaloonID_int, SaloonEntity.SaloonID_int))
                    {
                        item.SaloonID_int            = null;
                        LaderTypeKey.LaderTypeID_int = item.LaderTypeID_int;
                        LaderTypeFactory.Update(item, LaderTypeKey);
                    }
                    foreach (HPS.BLL.LaderTypeBLL.BLLLaderType_T item in lstLaderTypeCheckBox.CheckedItems)
                    {
                        item.SaloonID_int            = SaloonEntity.SaloonID_int;
                        LaderTypeKey.LaderTypeID_int = item.LaderTypeID_int;
                        LaderTypeFactory.Update(item, LaderTypeKey);
                    }
                    //for (int i = 0; i < lstLaderTypeCheckBox.CheckedItems.Count; i++)
                    //{
                    //    ((HPS.BLL.LaderTypeBLL.BLLLaderType_T)this.lstLaderTypeCheckBox.CheckedItems[i]).SaloonID_int = SaloonEntity.SaloonID_int;
                    //    LaderTypeKey.LaderTypeID_int = ((HPS.BLL.LaderTypeBLL.BLLLaderType_T)this.lstLaderTypeCheckBox.CheckedItems[i]).LaderTypeID_int;
                    //    LaderTypeFactory.Update(((HPS.BLL.LaderTypeBLL.BLLLaderType_T)this.lstLaderTypeCheckBox.CheckedItems[i]), LaderTypeKey);
                    //}
                    SaloonFactory.CommitProc();

                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(HPS.BLL.SaloonBLL.BLLSaloon_T.Saloon_TField.SaloonID_int.ToString() + " = " + ((HPS.BLL.SaloonBLL.BLLSaloon_TKeys)Key).SaloonID_int.ToString() + "");
                        if (dr.Length > 0)
                        {
                            dr[0][HPS.BLL.SaloonBLL.BLLSaloon_T.Saloon_TField.SaloonID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(SaloonEntity.SaloonID_int, TypeCode.Int32);
                            dr[0][HPS.BLL.SaloonBLL.BLLSaloon_T.Saloon_TField.Saloon_nvc.ToString()]   = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(SaloonEntity.Saloon_nvc, TypeCode.String);
                            dr[0][HPS.BLL.SaloonBLL.BLLSaloon_T.Saloon_TField.TurnDistinictAfterCredit_int.ToString()]     = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(SaloonEntity.TurnDistinictAfterCredit_int, TypeCode.Int32);
                            dr[0][HPS.BLL.SaloonBLL.BLLSaloon_T.Saloon_TField.TurnNumberInLadeAnnouncement_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(SaloonEntity.TurnNumberInLadeAnnouncement_int, TypeCode.Int32);
                        }
                        DataTable.AcceptChanges();
                    }
                }
            }
            catch (Exception ex)
            {
                SaloonFactory.RollBackProc();
                throw ex;
            }
        }
Example #2
0
        protected override void Insert()
        {
            HPS.BLL.SaloonBLL.BLLSaloon_TFactory SaloonFactory = new HPS.BLL.SaloonBLL.BLLSaloon_TFactory();
            try
            {
                HPS.BLL.SaloonBLL.BLLSaloon_T SaloonEntity = new HPS.BLL.SaloonBLL.BLLSaloon_T();
                SaloonEntity.Saloon_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(Saloon_nvcTextBox.Text, TypeCode.String).ToString();
                SaloonEntity.TurnDistinictAfterCredit_int     = (Int32?)Hepsa.Core.Common.PersentationController.GetEntityValue(TurnDistinictAfterCredit_intNumericTextBox.NumericText, TypeCode.Int32);
                SaloonEntity.TurnNumberInLadeAnnouncement_int = (Int32?)Hepsa.Core.Common.PersentationController.GetEntityValue(TurnNumberInLadeAnnouncement_intNumericTextBox.NumericText, TypeCode.Int32);

                SaloonFactory.BeginProc();
                SaloonFactory.Insert(SaloonEntity);
                HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory();
                HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys    LaderTypeKey     = new HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys();

                for (int i = 0; i < lstLaderTypeCheckBox.CheckedItems.Count; i++)
                {
                    ((HPS.BLL.LaderTypeBLL.BLLLaderType_T) this.lstLaderTypeCheckBox.CheckedItems[i]).SaloonID_int = SaloonEntity.SaloonID_int;
                    LaderTypeKey.LaderTypeID_int = ((HPS.BLL.LaderTypeBLL.BLLLaderType_T) this.lstLaderTypeCheckBox.CheckedItems[i]).LaderTypeID_int;
                    LaderTypeFactory.Update(((HPS.BLL.LaderTypeBLL.BLLLaderType_T) this.lstLaderTypeCheckBox.CheckedItems[i]), LaderTypeKey);
                }

                SaloonFactory.CommitProc();

                if (DataTable != null)
                {
                    DataRow dr = this.DataTable.NewRow();
                    dr[HPS.BLL.SaloonBLL.BLLSaloon_T.Saloon_TField.SaloonID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(SaloonEntity.SaloonID_int, TypeCode.Int32);
                    dr[HPS.BLL.SaloonBLL.BLLSaloon_T.Saloon_TField.Saloon_nvc.ToString()]   = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(SaloonEntity.Saloon_nvc, TypeCode.String);
                    dr[HPS.BLL.SaloonBLL.BLLSaloon_T.Saloon_TField.TurnDistinictAfterCredit_int.ToString()]     = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(SaloonEntity.TurnDistinictAfterCredit_int, TypeCode.Int32);
                    dr[HPS.BLL.SaloonBLL.BLLSaloon_T.Saloon_TField.TurnNumberInLadeAnnouncement_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(SaloonEntity.TurnNumberInLadeAnnouncement_int, TypeCode.Int32);

                    DataTable.Rows.Add(dr);
                    DataTable.AcceptChanges();
                }
                this.ClearForm(this);
            }
            catch (Exception ex)
            {
                SaloonFactory.RollBackProc();
                throw ex;
            }
        }
Example #3
0
        protected override void Edit()
        {
            HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory();
            try
            {
                HPS.BLL.LaderTypeBLL.BLLLaderType_T LaderTypeEntity = new HPS.BLL.LaderTypeBLL.BLLLaderType_T();
                LaderTypeEntity.LaderTypeCode_nvc     = Hepsa.Core.Common.PersentationController.GetEntityValue(LaderTypeCode_nvcTextBox.Text, TypeCode.String).ToString();
                LaderTypeEntity.LaderType_nvc         = Hepsa.Core.Common.PersentationController.GetEntityValue(LaderType_nvcTextBox.Text, TypeCode.String).ToString();
                LaderTypeEntity.MinTruckWeight_dec    = (Nullable <Decimal>)Hepsa.Core.Common.PersentationController.GetEntityValue(MinTruckWeight_decNumericTextBox.NumericText, TypeCode.Decimal);
                LaderTypeEntity.MaxTruckWeight_dec    = (Nullable <Decimal>)Hepsa.Core.Common.PersentationController.GetEntityValue(MaxTruckWeight_decNumericTextBox.NumericText, TypeCode.Decimal);
                LaderTypeEntity.Active_bit            = Active_bitCheckBox.Checked;
                LaderTypeEntity.LaderPivotGroupID_int = (Nullable <Int32>)Hepsa.Core.Common.PersentationController.GetEntityValue(LaderPivotGroupID_intComboBox.SelectedValue, TypeCode.Int32);
                LaderTypeEntity.TurnCancel_bit        = TurnCancelCheckBox.Checked;

                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.EditMessage) == true)
                {
                    LaderTypeFactory.BeginProc();
                    LaderTypeFactory.Update(LaderTypeEntity, (HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys)Key);
                    LaderTypeFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderTypeID_int.ToString() + "='" + ((HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys)Key).LaderTypeID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0][HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderTypeCode_nvc.ToString()]  = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.LaderTypeCode_nvc, TypeCode.String);
                            dr[0][HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderType_nvc.ToString()]      = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.LaderType_nvc, TypeCode.String);
                            dr[0][HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.MinTruckWeight_dec.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.MinTruckWeight_dec, TypeCode.Decimal);
                            dr[0][HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.MaxTruckWeight_dec.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.MaxTruckWeight_dec, TypeCode.Decimal);
                            dr[0][HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.Active_bit.ToString()]         = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.Active_bit, TypeCode.Boolean);
                            dr[0]["LaderPivotGroupID_intLaderPivotGroup_nvc"] = Hepsa.Core.Common.PersentationController.GetComboBoxDisplayMember(LaderPivotGroupID_intComboBox);
                            dr[0][HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.TurnCancel_bit.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.TurnCancel_bit, TypeCode.Boolean);
                        }
                        DataTable.AcceptChanges();
                    }
                }
            }
            catch (Exception ex)
            {
                LaderTypeFactory.RollBackProc();
                throw ex;
            }
        }