Esempio n. 1
0
        public void Update()
        {
            ClsPerson Obj = this.mObj_Person;

            Obj.pDr["FirstName"]  = this.Txt_FirstName.Text;
            Obj.pDr["MiddleName"] = this.Txt_MiddleName.Text;
            Obj.pDr["LastName"]   = this.Txt_LastName.Text;

            System.Text.StringBuilder Sb_FullName = new System.Text.StringBuilder();
            Sb_FullName.Append(this.Txt_FirstName.Text);
            Sb_FullName.Append(" ");
            Sb_FullName.Append(this.Txt_MiddleName.Text);
            Sb_FullName.Append(" ");
            Sb_FullName.Append(this.Txt_LastName.Text);

            Obj.pDr["FullName"] = Sb_FullName.ToString();

            this.Details_FormatPhoneNo(ref this.Txt_Phone);
            this.Details_FormatPhoneNo(ref this.Txt_Mobile);
            this.Details_FormatPhoneNo(ref this.Txt_Fax);

            Obj.pDr["Phone"]     = this.Txt_Phone.Text;
            Obj.pDr["Mobile"]    = this.Txt_Mobile.Text;
            Obj.pDr["Fax"]       = this.Txt_Fax.Text;
            Obj.pDr["Email"]     = this.Txt_Email.Text;
            Obj.pDr["WorkEmail"] = this.Txt_Email_Work.Text;

            try
            { Obj.pDr["BirthDate"] = this.EODtp_BirthDate.SelectedDate; }
            catch
            { Obj.pDr["BirthDate"] = DBNull.Value; }

            Do_Methods.ConvertCaps(Obj.pDr);
        }
        protected override void Save()
        {
            System.Text.StringBuilder Sb_ErrorMsg = new System.Text.StringBuilder();
            if (!this.Save_Validation(ref Sb_ErrorMsg))
            {
                this.Show_EventMsg(Sb_ErrorMsg.ToString(), ClsBaseMasterDetails.eStatus.Event_Error);
                return;
            }

            //[-]

            this.mObj.pDr_RowProperty["Code"]      = this.Txt_EmployeeCode.Text;
            this.mObj.pDr["Leave_Vacation"]        = Do_Methods.Convert_Int32(this.Txt_LeaveSick.Text);
            this.mObj.pDr["Leave_Sick"]            = Do_Methods.Convert_Int32(this.Txt_LeaveSick.Text);
            this.mObj.pDr["Leave_Bereavement"]     = Do_Methods.Convert_Int32(this.Txt_LeaveBereavement.Text);
            this.mObj.pDr["Position"]              = this.Txt_Position.Text;
            this.mObj.pDr["LookupID_Department"]   = Do_Methods.Convert_Int64(this.Cbo_Department.SelectedValue);
            this.mObj.pDr["LookupID_PayRate"]      = Do_Methods.Convert_Int64(this.Cbo_PayRate.SelectedValue);
            this.mObj.pDr["LookupID_EmployeeType"] = Do_Methods.Convert_Int64(this.Cbo_EmployeeType.SelectedValue);
            this.mObj.pDr["SIN"] = this.Txt_SIN.Text;
            this.mObj.pDr["Pay"] = Do_Methods.Convert_Double(this.Txt_Pay.Text);

            this.UcPerson.Update();
            this.UcAddress.Update();

            Do_Methods.ConvertCaps(this.mObj.pDr_RowProperty);
            Do_Methods.ConvertCaps(this.mObj.pDr_Person);
            Do_Methods.ConvertCaps(this.mObj.pDr);

            //[-]

            base.Save();
        }
Esempio n. 3
0
        void Update()
        {
            DataRow[] ArrDr = this.mObj_Customer.pDt_ShippingAddress.Select("", "", DataViewRowState.CurrentRows);
            foreach (DataRow Dr in ArrDr)
            {
                Dr["IsActive"] = false;
            }

            ArrDr = this.mObj_Customer.pDt_ShippingAddress.Select("TmpKey = " + this.mTmpKey.ToString(), "", DataViewRowState.CurrentRows);
            DataRow Dr_ShippingAddress = null;

            if (ArrDr.Length > 0)
            {
                Dr_ShippingAddress = ArrDr[0];
            }
            else
            {
                throw new DataObjects_Framework.Objects.CustomException("Shipping Address Data Error.");

                //Int64 TmpKey = 0;
                //ArrDr = this.mObj_Customer.pDt_ShippingAddress.Select("", "TmpKey Desc", DataViewRowState.CurrentRows);
                //if (ArrDr.Length > 0)
                //{ TmpKey = Convert.ToInt64(ArrDr[0]["TmpKey"]); }
                //TmpKey++;

                //Dr_ShippingAddress = this.mObj_Customer.pDt_ShippingAddress.NewRow();
                //Dr_ShippingAddress["TmpKey"] = TmpKey;
                //this.mObj_Customer.pDt_ShippingAddress.Rows.Add(Dr_ShippingAddress);
                //this.mObj_Customer.pBO_ShippingAddress_Address.Add(TmpKey.ToString(), this.mObj_Address);
            }

            this.UcAddress_ShippingAddress.Update();

            Dr_ShippingAddress["StoreCode"] = this.Txt_StoreCode.Text;
            Dr_ShippingAddress["IsActive"]  = true;
            Dr_ShippingAddress["Address"]   = Do_Methods.IsNull(this.mObj_Address.pDr["Address_Complete"], "");

            Do_Methods.ConvertCaps(Dr_ShippingAddress);

            this.mTmpKey = Convert.ToInt64(Do_Methods.IsNull(Dr_ShippingAddress["TmpKey"], 0));
            if (EvAccept != null)
            {
                EvAccept(this.mTmpKey);
            }
        }
Esempio n. 4
0
        void Update()
        {
            DataRow[] ArrDr            = this.mObj_ContactPerson.pDt_ContactPerson.Select("TmpKey = " + this.mTmpKey, "", DataViewRowState.CurrentRows);
            DataRow   Dr_ContactPerson = null;

            if (ArrDr.Length > 0)
            {
                Dr_ContactPerson = ArrDr[0];
            }
            else
            {
                //Int64 TmpKey = 0;
                //ArrDr = this.mObj_ContactPerson.pDt_ContactPerson.Select("", "TmpKey Desc", DataViewRowState.CurrentRows);
                //if (ArrDr.Length > 0)
                //{ TmpKey = System.Convert.ToInt64(ArrDr[0]["TmpKey"]); }
                //TmpKey++;

                //Dr_ContactPerson = this.mObj_ContactPerson.pDt_ContactPerson.NewRow();
                //Dr_ContactPerson["TmpKey"] = TmpKey;
                //this.mObj_ContactPerson.pDt_ContactPerson.Rows.Add(Dr_ContactPerson);
                //this.mObj_ContactPerson.pBO_ContactPerson_Persons.Add(TmpKey.ToString(), this.mObj_Person);

                Dr_ContactPerson = this.mObj_ContactPerson.pObj_ContactPerson_Details.Add_Item();
            }

            this.UcPerson.Update();

            Dr_ContactPerson["Position"]  = this.Txt_Position.Text;
            Dr_ContactPerson["FullName"]  = Do_Methods.IsNull(this.mObj_Person.pDr["FullName"], "");
            Dr_ContactPerson["Phone"]     = Do_Methods.IsNull(this.mObj_Person.pDr["Phone"], "");
            Dr_ContactPerson["Mobile"]    = Do_Methods.IsNull(this.mObj_Person.pDr["Mobile"], "");
            Dr_ContactPerson["Fax"]       = Do_Methods.IsNull(this.mObj_Person.pDr["Fax"], "");
            Dr_ContactPerson["Email"]     = Do_Methods.IsNull(this.mObj_Person.pDr["Email"], "");
            Dr_ContactPerson["WorkEmail"] = Do_Methods.IsNull(this.mObj_Person.pDr["WorkEmail"], "");

            Do_Methods.ConvertCaps(Dr_ContactPerson);
            this.mTmpKey = System.Convert.ToInt64(Do_Methods.IsNull(Dr_ContactPerson["TmpKey"], 0));

            if (EvAccept != null)
            {
                EvAccept();
            }
        }
Esempio n. 5
0
        public void Update()
        {
            ClsAddress Obj = this.mObj_Address;

            Obj.pDr["Address"]          = this.Txt_Address.Text;
            Obj.pDr["City"]             = this.Txt_City.Text;
            Obj.pDr["ZipCode"]          = this.Txt_ZipCode.Text;
            Obj.pDr["LookupID_States"]  = Convert.ToInt64(this.Cbo_State.SelectedValue);
            Obj.pDr["LookupID_Country"] = Convert.ToInt64(this.Cbo_Country.SelectedValue);

            System.Text.StringBuilder Sb_Address = new System.Text.StringBuilder();
            Sb_Address.Append(this.Txt_Address.Text);
            Sb_Address.Append("\r " + this.Txt_City.Text);
            Sb_Address.Append("\r " + (this.Cbo_State.SelectedValue == "0" ? "" : this.Cbo_State.SelectedItem.Text));
            Sb_Address.Append("\r " + this.Txt_ZipCode.Text);
            Sb_Address.Append("\r " + (this.Cbo_Country.SelectedValue == "0" ? "" : this.Cbo_Country.SelectedItem.Text));

            Obj.pDr["Address_Complete"] = Sb_Address.ToString();

            Do_Methods.ConvertCaps(Obj.pDr);
        }
Esempio n. 6
0
        protected override void Save()
        {
            System.Text.StringBuilder Sb_ErrorMsg = new System.Text.StringBuilder();
            if (!this.Save_Validation(ref Sb_ErrorMsg))
            {
                this.Show_EventMsg(Sb_ErrorMsg.ToString(), ClsBaseMasterDetails.eStatus.Event_Error);
                return;
            }

            this.UcPerson.Update();
            this.UcAddress.Update();

            this.mObj.pDr_RowProperty["Code"]     = this.Txt_Code.Text;
            this.mObj.pDr["Company"]              = this.Txt_Company.Text;
            this.mObj.pDr["LookupTaxCodeID"]      = Convert.ToInt64(this.Cbo_TaxCode.SelectedValue);
            this.mObj.pDr["LookupClientTypeID"]   = Convert.ToInt64(this.Cbo_ClientType.SelectedValue);
            this.mObj.pDr["LookupID_ShipVia"]     = Convert.ToInt64(this.Cbo_ShipVia.SelectedValue);
            this.mObj.pDr["LookupID_Currency"]    = Convert.ToInt64(this.Cbo_Currency.SelectedValue);
            this.mObj.pDr["LookupID_PaymentTerm"] = Convert.ToInt64(this.Cbo_PaymentTerm.SelectedValue);

            this.mObj.pDr["IsCreditHold"]           = this.Chk_IsCreditHold.Checked;
            this.mObj.pDr["CreditCard_AccountName"] = this.Txt_CreditCard_AccountName.Text;

            Int32 CreditCardExpiration_Month = 0;
            Int32 CreditCardExpiration_Year  = 0;

            try
            {
                Int32.TryParse(this.Txt_CreditCardExpiration_Month.Text, out CreditCardExpiration_Month);
                if (this.Txt_CreditCardExpiration_Year.Text.Trim() != "")
                {
                    Int32.TryParse("20" + this.Txt_CreditCardExpiration_Year.Text, out CreditCardExpiration_Year);
                }
            }
            catch { }

            if (
                (this.Txt_CreditCardExpiration_Month.Text.Trim() == "" ||
                 this.Txt_CreditCardExpiration_Year.Text.Trim() == ""))
            {
                this.mObj.pDr["CreditCard_Expiration"] = DBNull.Value;
            }
            else
            {
                try
                { this.mObj.pDr["CreditCard_Expiration"] = new DateTime(CreditCardExpiration_Year, CreditCardExpiration_Month, 1); }
                catch
                { this.mObj.pDr["CreditCard_Expiration"] = DBNull.Value; }
            }

            this.mObj.pDr["CreditCard_CVV"] = this.Txt_CreditCard_CVV.Text;

            this.mObj.pDr["CreditCardNo1"] = this.Txt_CreditCard_Part1.Text;
            this.mObj.pDr["CreditCardNo2"] = this.Txt_CreditCard_Part2.Text;
            this.mObj.pDr["CreditCardNo3"] = this.Txt_CreditCard_Part3.Text;
            this.mObj.pDr["CreditCardNo4"] = this.Txt_CreditCard_Part4.Text;

            this.mObj.pDr["CreditLimit"] = Do_Methods.Convert_Double(this.Txt_CreditLimit.Text);

            Do_Methods.ConvertCaps(this.mObj.pDr_RowProperty);
            Do_Methods.ConvertCaps(this.mObj.pDr_Person);
            Do_Methods.ConvertCaps(this.mObj.pDr_Address);
            Do_Methods.ConvertCaps(this.mObj.pDr);

            base.Save();
        }
        protected override void Save()
        {
            this.UcGrid_ItemPart.Post();
            this.UcGrid_ItemLocation.Post();
            this.UcGrid_ItemSupplier.Post();

            //[-]

            //System.Text.StringBuilder Sb_ErrorMsg = new System.Text.StringBuilder();
            //if (!this.Save_Validation(ref Sb_ErrorMsg))
            //{
            //    this.Show_EventMsg(Sb_ErrorMsg.ToString(), ClsBaseMasterDetails.eStatus.Event_Error);
            //    return;
            //}

            //[-]

            this.mObj.pDr_RowProperty["Code"]    = this.Txt_ItemCode.Text;
            this.mObj.pDr_RowProperty["Name"]    = this.Txt_ItemName.Text;
            this.mObj.pDr_RowProperty["Remarks"] = this.Txt_Remarks.Text;

            this.mObj.pDr["Warranty"]          = this.Txt_Warranty.Text;
            this.mObj.pDr["IsSerial"]          = this.Chk_IsSerial.Checked;
            this.mObj.pDr["LookupID_ItemType"] = Convert.ToInt64(this.Cbo_ItemType.SelectedValue);
            this.mObj.pDr["LookupID_Brand"]    = Convert.ToInt64(this.Cbo_Brand.SelectedValue);
            this.mObj.pDr["LookupID_Retailer"] = Convert.ToInt64(this.Cbo_Retailer.SelectedValue);
            this.mObj.pDr["LookupID_ItemUOM"]  = Convert.ToInt64(this.Cbo_ItemUOM.SelectedValue);

            this.mObj.pDr["Size_Length"] = Do_Methods.Convert_Double(this.Txt_Length.Text);
            this.mObj.pDr["Size_Width"]  = Do_Methods.Convert_Double(this.Txt_Width.Text);
            this.mObj.pDr["Size_Height"] = Do_Methods.Convert_Double(this.Txt_Height.Text);
            this.mObj.pDr["Size_Weight"] = Do_Methods.Convert_Double(this.Txt_Weight.Text);

            this.mObj.pDr["Inv_FloorLevel"]   = Do_Methods.Convert_Int64(this.Txt_FloorLevel.Text);
            this.mObj.pDr["Inv_ReorderLevel"] = Do_Methods.Convert_Int64(this.Txt_ReorderLevel.Text);
            this.mObj.pDr["Inv_CeilingLevel"] = Do_Methods.Convert_Int64(this.Txt_CeilingLevel.Text);

            this.mObj.pDr["Cost"]  = Do_Methods.Convert_Double(this.Txt_EstimatedCost.Text);
            this.mObj.pDr["Price"] = Do_Methods.Convert_Double(this.Txt_ListPrice.Text);

            Do_Methods.ConvertCaps(this.mObj.pDr_RowProperty);
            Do_Methods.ConvertCaps(this.mObj.pDr);

            //[-]

            ClsItemValidation Obj_Validation = new ClsItemValidation();

            Obj_Validation.Setup(this.mObj);
            if (!Obj_Validation.Validate())
            {
                this.Txt_ItemCode.CssClass = Layer01_Constants_Web.CnsCssTextbox;
                //if (Obj_Validation.pList_ValidationError.Exists(X => X.Name == ClsItemValidation.eErrors.Err_Code.ToString()))
                if (Obj_Validation.FindError(ClsItemValidation.eErrors.Err_Code.ToString()))
                {
                    this.Txt_ItemCode.CssClass = Layer01_Constants_Web.CnsCssTextbox_ValidateHighlight;
                }

                this.Txt_ItemName.CssClass = Layer01_Constants_Web.CnsCssTextbox;
                //if (Obj_Validation.pList_ValidationError.Exists(X => X.Name == ClsItemValidation.eErrors.Err_Name.ToString()))
                if (Obj_Validation.FindError(ClsItemValidation.eErrors.Err_Name.ToString()))
                {
                    this.Txt_ItemName.CssClass = Layer01_Constants_Web.CnsCssTextbox_ValidateHighlight;
                }

                //List<String> Msg = (from O in Obj_Validation.pList_ValidationError select O.Message).ToList();
                //this.Show_EventMsg(Msg, ClsBaseMasterDetails.eStatus.Event_Error);

                this.Show_EventMsg(Obj_Validation.GetErrors(), ClsBaseMasterDetails.eStatus.Event_Error);
            }

            //[-]

            base.Save();
        }