void BindGrid_Details()
        {
            this.UcGrid_Details.Setup("User_Rights", this.mObj.pDt_Rights, "TmpKey", true);

            //[-]

            DataTable Dt_FilterFields = new DataTable();

            Dt_FilterFields.Columns.Add("Desc", typeof(string));
            Dt_FilterFields.Columns.Add("Field", typeof(string));
            Dt_FilterFields.Columns.Add("DataType", typeof(string));

            List <ClsBindGridColumn_EO> List_Gc = Layer01_Methods_Web_EO.GetBindGridColumn_EO("User_Rights");

            foreach (ClsBindGridColumn Gc in List_Gc)
            {
                if (Gc.mVisible && Gc.mFieldName != "")
                {
                    List <QueryParameter> Sp = new List <QueryParameter>();
                    Sp.Add(new QueryParameter("Field", Gc.mFieldName));
                    Sp.Add(new QueryParameter("Desc", Gc.mFieldDesc));
                    Sp.Add(new QueryParameter("DataType", this.mObj.pDt_Rights.Columns[Gc.mFieldName].DataType.Name));
                    Do_Methods.AddDataRow(ref Dt_FilterFields, Sp);
                }
            }

            Layer01_Methods_Web.BindCombo(ref this.Cbo_SearchFilter, Dt_FilterFields, "Field", "Desc");
            this.ViewState[CnsDt_FilterFields] = Dt_FilterFields;
        }
        void Page_Load(object sender, EventArgs e)
        {
            if (!this.CheckIsLoaded())
            {
                try
                {
                    this.mCurrentUser      = this.mMaster.pCurrentUser;
                    this.mSystem_ModulesID = (Int64)this.ViewState[CnsSystem_ModulesID];
                    this.mIsReadOnly       = this.pIsReadOnly;
                    this.mObjID            = (string)this.ViewState[CnsObjID];
                    this.mObj_Base         = (ClsBase)this.Session[this.mObjID];

                    if (!this.IsPostBack)
                    {
                        this.SetupPage();
                        this.Save_Redirected();
                    }

                    this.SetupPage_ControlAttributes();
                }
                catch (Exception ex)
                {
                    Layer01_Methods_Web.ErrorHandler(ex, this.Server);
                    throw ex;
                }
            }
        }
 void SetupPage_Lookups()
 {
     Layer01_Methods_Web.BindCombo(ref this.Cbo_Category, Do_Methods_Query.GetLookup("Category"), "LookupID", "Desc", 0, "-Select-");
     Layer01_Methods_Web.BindCombo(ref this.Cbo_ItemType, Do_Methods_Query.GetLookup("ItemType"), "LookupID", "Desc", 0, "-Select-");
     Layer01_Methods_Web.BindCombo(ref this.Cbo_Brand, Do_Methods_Query.GetLookup("Brand"), "LookupID", "Desc", 0, "-Select-");
     Layer01_Methods_Web.BindCombo(ref this.Cbo_Retailer, Do_Methods_Query.GetLookup("Retailer"), "LookupID", "Desc", 0, "-Select-");
     Layer01_Methods_Web.BindCombo(ref this.Cbo_ItemUOM, Do_Methods_Query.GetLookup("UOM"), "LookupID", "Desc", 0, "-Select-");
 }
Example #4
0
 void EOCb_Accept_Execute(object sender, EO.Web.CallbackEventArgs e)
 {
     try
     { this.Update(); }
     catch (Exception Ex)
     {
         Layer01_Methods_Web.ErrorHandler(Ex, this.Server);
         throw Ex;
     }
 }
Example #5
0
 void EOCb_TaxCode_Execute(object sender, EO.Web.CallbackEventArgs e)
 {
     try
     { e.Data = this.Details_TaxCode(); }
     catch (Exception Ex)
     {
         Layer01_Methods_Web.ErrorHandler(Ex, this.Server);
         throw Ex;
     }
 }
 void Btn_Save_Click(object sender, EventArgs e)
 {
     try
     { this.RaiseSave(); }
     catch (Exception Ex)
     {
         Layer01_Methods_Web.ErrorHandler(Ex, this.Server);
         this.Show_EventMsg(Ex.Message, eStatus.Event_Error);
     }
 }
Example #7
0
 void EOCb_Cancel_Execute(object sender, EO.Web.CallbackEventArgs e)
 {
     try
     {
         this.mObj_Customer.pObj_ShippingAddress.Delete_Item(this.mTmpKey);
         this.mTmpKey = 0;
         this.ViewState[CnsTmpKey] = this.mTmpKey;
     }
     catch (Exception Ex)
     {
         Layer01_Methods_Web.ErrorHandler(Ex, this.Server);
         throw Ex;
     }
 }
Example #8
0
 void EOCb_ShippingAddress_Update_Execute(object sender, EO.Web.CallbackEventArgs e)
 {
     try
     {
         this.UcAddress.Update();
         this.UcGrid_ShippingAddress.Post();
         this.UcCdsa.AddNew(this.mObj);
     }
     catch (Exception Ex)
     {
         Layer01_Methods_Web.ErrorHandler(Ex, this.Server);
         throw Ex;
     }
 }
Example #9
0
        string Details_SelectEmployee(Int64 ID)
        {
            this.mObj.pDr["EmployeeID_SalesPerson"] = ID;

            System.Text.StringBuilder Sb_Js = new System.Text.StringBuilder();
            DataTable Dt = Do_Methods_Query.GetQuery("uvw_Employee", "", "EmployeeID = " + ID.ToString());

            if (Dt.Rows.Count > 0)
            {
                this.Lbl_SalesPerson.Text = (string)Do_Methods.IsNull(Dt.Rows[0]["EmployeeCodeName"], "");
                Layer01_Methods_Web.Eval_AppendJs(this.Server, ref Sb_Js, this.Lbl_SalesPerson.ClientID, "innerHTML", this.Lbl_SalesPerson.Text);
            }

            return(Sb_Js.ToString());
        }
Example #10
0
 void EOCb_Selection_Execute(object sender, EO.Web.CallbackEventArgs e)
 {
     try
     {
         if (e.Parameter == this.Btn_SalesPerson.ID)
         {
             this.UcSelection.Show("Select_Employee");
         }
     }
     catch (Exception Ex)
     {
         Layer01_Methods_Web.ErrorHandler(Ex, this.Server);
         throw Ex;
     }
 }
Example #11
0
 void EOCb_ShippingAddress_Edit_Execute(object sender, EO.Web.CallbackEventArgs e)
 {
     try
     {
         Int64 Key = 0;
         try
         { Key = Convert.ToInt64(e.Parameter); }
         catch { }
         e.Data = this.UcCdsa.Show(this.mObj, Key);
     }
     catch (Exception Ex)
     {
         Layer01_Methods_Web.ErrorHandler(Ex, this.Server);
         throw Ex;
     }
 }
Example #12
0
 void EOCb_ShippingAddress_Add_Execute(object sender, EO.Web.CallbackEventArgs e)
 {
     try
     {
         if (e.Parameter == this.Btn_AddShippingAddress.ID)
         {
             this.UcGrid_ShippingAddress.Post();
             e.Data = this.UcCdsa.Show(this.mObj);
         }
     }
     catch (Exception Ex)
     {
         Layer01_Methods_Web.ErrorHandler(Ex, this.Server);
         throw Ex;
     }
 }
Example #13
0
        public bool Update_Validate(ref System.Text.StringBuilder Sb_Msg)
        {
            bool       IsValid = true;
            WebControl Wc;

            Wc = this.Txt_FirstName;
            Layer01_Methods_Web.Save_Validation(
                ref Sb_Msg
                , ref Wc
                , ref IsValid
                , Layer01_Constants_Web.CnsCssTextbox
                , Layer01_Constants_Web.CnsCssTextbox_ValidateHighlight
                , (this.Txt_FirstName.Text.Trim() != "")
                , "First Name is required. <br />");

            Wc = this.Txt_MiddleName;
            Layer01_Methods_Web.Save_Validation(
                ref Sb_Msg
                , ref Wc
                , ref IsValid
                , Layer01_Constants_Web.CnsCssTextbox
                , Layer01_Constants_Web.CnsCssTextbox_ValidateHighlight
                , (this.Txt_MiddleName.Text.Trim() != "")
                , "Middle Name is required. <br />");

            Wc = this.Txt_LastName;
            Layer01_Methods_Web.Save_Validation(
                ref Sb_Msg
                , ref Wc
                , ref IsValid
                , Layer01_Constants_Web.CnsCssTextbox
                , Layer01_Constants_Web.CnsCssTextbox_ValidateHighlight
                , (this.Txt_LastName.Text.Trim() != "")
                , "Last Name is required. <br />");

            Wc = this.EODtp_BirthDate;
            Layer01_Methods_Web.Save_Validation(
                ref Sb_Msg
                , ref Wc
                , ref IsValid
                , Layer01_Constants_Web.CnsCssTextbox
                , Layer01_Constants_Web.CnsCssTextbox_ValidateHighlight
                , (this.EODtp_BirthDate.SelectedDate == null)
                , "Date of Birth is required. <br />");

            return(IsValid);
        }
Example #14
0
        bool Save_Validation(System.Text.StringBuilder Sb_Msg)
        {
            bool       IsValid = true;
            WebControl Wc;

            Wc = this.Txt_Name;
            Layer01_Methods_Web.Save_Validation(
                ref Sb_Msg
                , ref Wc
                , ref IsValid
                , Layer01_Constants_Web.CnsCssTextbox
                , Layer01_Constants_Web.CnsCssTextbox_ValidateHighlight
                , (this.Txt_Name.Text != "")
                , "Rights Name is required. <br />");

            return(IsValid);
        }
        void SetupPage()
        {
            List <ClsBindGridColumn> List_Gc = Layer01_Methods_Web.GetBindGridColumn(this.mSystem_BinDefinition_Name);

            this.ViewState[CnsList_Gc] = List_Gc;
            this.mList_Gc = List_Gc;

            JqGrid_DtBind JDtBind       = new JqGrid_DtBind(List_Gc);
            string        Json_ColNames = JDtBind.Serialize_ColNames();
            string        Json_ColModel = JDtBind.Serialize_ColModel();

            System.Text.StringBuilder Sb_Js = new System.Text.StringBuilder();
            Sb_Js.Append(@"var Grid_ColNames = " + Json_ColNames + @";");
            Sb_Js.Append(@"var Grid_ColModel = " + Json_ColModel + @";");

            this.Page.ClientScript.RegisterClientScriptBlock(typeof(string), this.ClientID, Sb_Js.ToString(), true);
        }
        void Details_SelectImage(string SelectedFile)
        {
            System.IO.FileInfo Fi             = new System.IO.FileInfo(this.MapPath(SelectedFile));
            string             FileName_Thumb = Layer01_Constants_Web.CnsImageThumbPath + "Thumb_" + Fi.Name;

            System.IO.FileInfo Fi_Thumb = new System.IO.FileInfo(this.MapPath(FileName_Thumb));

            Layer01_Methods_Web.ImageThumbnail(Fi.FullName, Fi_Thumb.FullName);

            this.Img_Box.ImageUrl       = this.ResolveUrl(FileName_Thumb);
            this.mObj.pDr["Image_Path"] = Fi.Name;
            this.Btn_ViewImage.Visible  = true;

            try
            { this.EOCbp_Image.Update(); }
            catch { }
        }
Example #17
0
        string Details_TaxCode()
        {
            System.Text.StringBuilder Sb_Js = new System.Text.StringBuilder();
            Int64 LookupTaxCodeID           = 0;

            try
            { LookupTaxCodeID = Convert.ToInt64(this.Cbo_TaxCode.SelectedValue); }
            catch { }

            DataTable Dt = Do_Methods_Query.GetQuery("LookupTaxCode", "", "LookupTaxCodeID = " + LookupTaxCodeID);

            if (Dt.Rows.Count > 0)
            {
                DataRow Dr = Dt.Rows[0];
                Layer01_Methods_Web.Eval_AppendJs(this.Server, ref Sb_Js, this.Lbl_PST_Value.ClientID, "innerHTML", Strings.Format(Do_Methods.IsNull(Dr["PST_Value"], 0), "#,##0.00"));
                Layer01_Methods_Web.Eval_AppendJs(this.Server, ref Sb_Js, this.Lbl_GST_Value.ClientID, "innerHTML", Strings.Format(Do_Methods.IsNull(Dr["GST_Value"], 0), "#,##0.00"));
                Layer01_Methods_Web.Eval_AppendJs(this.Server, ref Sb_Js, this.Lbl_HST_Value.ClientID, "innerHTML", Strings.Format(Do_Methods.IsNull(Dr["HST_Value"], 0), "#,##0.00"));
            }
            return(Sb_Js.ToString());
        }
Example #18
0
 void SetupPage_Lookups()
 {
     Layer01_Methods_Web.BindCombo(ref this.Cbo_Currency, Do_Methods_Query.GetLookup("Currency"), "LookupID", "Desc", 0, "-Select-");
     Layer01_Methods_Web.BindCombo(ref this.Cbo_PaymentTerm, Do_Methods_Query.GetLookup("PaymentTerm"), "LookupID", "Desc", 0, "-Select-");
     Layer01_Methods_Web.BindCombo(ref this.Cbo_ShipVia, Do_Methods_Query.GetLookup("ShipVia"), "LookupID", "Desc", 0, "-Select-");
     Layer01_Methods_Web.BindCombo(
         ref this.Cbo_TaxCode
         , Do_Methods_Query.GetQuery("LookupTaxCode", "", "IsNull(IsDeleted,0) = 0 And IsNull(IsActive,0) = 1")
         , "LookupTaxCodeID"
         , "Desc"
         , 0
         , "-Select-");
     Layer01_Methods_Web.BindCombo(
         ref this.Cbo_ClientType
         , Do_Methods_Query.GetQuery("LookupClientType", "", "IsNull(IsDeleted,0) = 0 And IsNull(IsActive,0) = 1")
         , "LookupClientTypeID"
         , "Desc"
         , 0
         , "-Select-");
 }
        bool Save_Validation(System.Text.StringBuilder Sb_Msg)
        {
            bool       IsValid = true;
            WebControl Wc;

            Wc = this.Txt_Username;
            Layer01_Methods_Web.Save_Validation(
                ref Sb_Msg
                , ref Wc
                , ref IsValid
                , Layer01_Constants_Web.CnsCssTextbox
                , Layer01_Constants_Web.CnsCssTextbox_ValidateHighlight
                , (this.Txt_Username.Text != "")
                , "User Name is required. <br />");

            Wc = this.Txt_Username;
            Layer01_Methods_Web.Save_Validation(
                ref Sb_Msg
                , ref Wc
                , ref IsValid
                , Layer01_Constants_Web.CnsCssTextbox
                , Layer01_Constants_Web.CnsCssTextbox_ValidateHighlight
                , (!Layer02_Common.CheckSeriesDuplicate("User", "UserName", this.mObj.GetKeys(), this.Txt_Username.Text))
                , "User Name is required. <br />");

            this.Txt_Password.CssClass        = Layer01_Constants_Web.CnsCssTextbox;
            this.Txt_ConfirmPassword.CssClass = Layer01_Constants_Web.CnsCssTextbox;

            if (this.Txt_Password.Text.Trim() != "")
            {
                if (this.Txt_Password.Text != this.Txt_ConfirmPassword.Text)
                {
                    IsValid = false;
                    this.Txt_Password.CssClass        = Layer01_Constants_Web.CnsCssTextbox_ValidateHighlight;
                    this.Txt_ConfirmPassword.CssClass = Layer01_Constants_Web.CnsCssTextbox_ValidateHighlight;
                    Sb_Msg.Append("Please confirm your password. <br />");
                }
            }

            return(IsValid);
        }
Example #20
0
        void EOCb_Txt_Changed_Execute(object sender, EO.Web.CallbackEventArgs e)
        {
            System.Text.StringBuilder Sb_Js = new System.Text.StringBuilder();

            if (e.Parameter == this.Txt_Phone.ID)
            {
                this.Details_FormatPhoneNo(ref this.Txt_Phone);
                Layer01_Methods_Web.Eval_AppendJs(this.Server, ref Sb_Js, this.Txt_Phone.ClientID, "value", this.Txt_Phone.Text);
            }
            else if (e.Parameter == this.Txt_Mobile.ID)
            {
                this.Details_FormatPhoneNo(ref this.Txt_Mobile);
                Layer01_Methods_Web.Eval_AppendJs(this.Server, ref Sb_Js, this.Txt_Mobile.ClientID, "value", this.Txt_Mobile.Text);
            }
            else if (e.Parameter == this.Txt_Fax.ID)
            {
                this.Details_FormatPhoneNo(ref this.Txt_Fax);
                Layer01_Methods_Web.Eval_AppendJs(this.Server, ref Sb_Js, this.Txt_Fax.ClientID, "value", this.Txt_Fax.Text);
            }

            e.Data = Sb_Js.ToString();
        }
        void Details_SetPaginator(Int64 Top, Int64 Items)
        {
            Int64 Pages = (Int64)Items / (Int64)Top;

            if ((Items % Top) > 0)
            {
                Pages++;
            }

            DataTable Dt = new DataTable();

            Dt.Columns.Add("Page", typeof(Int64));
            for (Int64 Ct = 1; Ct <= Pages; Ct++)
            {
                List <QueryParameter> Sp = new List <QueryParameter>();
                Sp.Add(new QueryParameter("Page", Ct));
                Do_Methods.AddDataRow(ref Dt, Sp);
            }

            Layer01_Methods_Web.BindCombo(ref this.Cbo_Page, Dt, "Page", "Page");
            this.ViewState[CnsItemsMax] = Items;
        }
Example #22
0
        void EOCb_ShippingAddress_IsActive_Execute(object sender, EO.Web.CallbackEventArgs e)
        {
            try
            {
                Int64 Key = 0;
                try
                { Key = Convert.ToInt64(e.Parameter); }
                catch { }

                if (Key == 0)
                {
                    return;
                }

                this.Details_ShippingAddress_IsActive(Key);
            }
            catch (Exception Ex)
            {
                Layer01_Methods_Web.ErrorHandler(Ex, this.Server);
                throw Ex;
            }
        }
 void EOCb_Selection_Execute(object sender, EO.Web.CallbackEventArgs e)
 {
     try
     {
         if (e.Parameter == this.Btn_AddItemPart.ID)
         {
             this.UcSelection.Show("Select_Item", "", true, e.Parameter);
         }
         else if (e.Parameter == this.Btn_AddItemSupplier.ID)
         {
             this.UcSelection.Show("Select_Supplier", "", true, e.Parameter);
         }
         else if (e.Parameter == this.Btn_AddItemLocation.ID)
         {
             this.UcSelection.Show("Select_Warehouse", "", true, e.Parameter);
         }
     }
     catch (Exception Ex)
     {
         Layer01_Methods_Web.ErrorHandler(Ex, this.Server);
         throw Ex;
     }
 }
        void SetupPage_CssClass(ref Control C, ref System.Text.StringBuilder Sb)
        {
            WebControl Wc = null;

            if (C is WebControl)
            {
                Wc = (WebControl)C;
                Layer01_Methods_Web.Eval_AppendJs(this.Server, ref Sb, Wc.ClientID, "class", Wc.CssClass);
                foreach (Control Ic in C.Controls)
                {
                    Control Inner_Ic = Ic;
                    this.SetupPage_CssClass(ref Inner_Ic, ref Sb);
                }
            }
            else
            {
                foreach (Control Ic in C.Controls)
                {
                    Control Inner_Ic = Ic;
                    this.SetupPage_CssClass(ref Inner_Ic, ref Sb);
                }
                return;
            }
        }
 void SetupPage_Lookups()
 {
     Layer01_Methods_Web.BindCombo(ref this.Cbo_Department, Do_Methods_Query.GetLookup("Department"), "LookupID", "Desc", 0, "-Select-");
     Layer01_Methods_Web.BindCombo(ref this.Cbo_PayRate, Do_Methods_Query.GetLookup("PayRate"), "LookupID", "Desc", 0, "-Select-");
     Layer01_Methods_Web.BindCombo(ref this.Cbo_EmployeeType, Do_Methods_Query.GetLookup("EmployeeType"), "LookupID", "Desc", 0, "-Select-");
 }
Example #26
0
 void SetupPage_ControlAttributes()
 {
     Layer01_Methods_Web.AddControlAttributes(this.Txt_Mobile, this.Page, "onchange", @"Txt_Changed('" + this.Txt_Mobile.ID + @"',e);", new string[] { "e" }, new string[] { "this" });
     Layer01_Methods_Web.AddControlAttributes(this.Txt_Phone, this.Page, "onchange", @"Txt_Changed('" + this.Txt_Phone.ID + @"',e);", new string[] { "e" }, new string[] { "this" });
     Layer01_Methods_Web.AddControlAttributes(this.Txt_Fax, this.Page, "onchange", @"Txt_Changed('" + this.Txt_Fax.ID + @"',e);", new string[] { "e" }, new string[] { "this" });
 }
Example #27
0
        bool Save_Validation(ref System.Text.StringBuilder Sb_Msg)
        {
            WebControl Wc;
            bool       IsValid = true;

            this.Txt_Code.CssClass = Layer01_Constants_Web.CnsCssTextbox;
            if (this.Txt_Code.Text.Trim() == "")
            {
                this.Txt_Code.Text = Layer02_Common.GetSeriesNo("Customer");
            }

            Wc = this.Txt_Code;
            Layer01_Methods_Web.Save_Validation(
                ref Sb_Msg
                , ref Wc
                , ref IsValid
                , Layer01_Constants_Web.CnsCssTextbox
                , Layer01_Constants_Web.CnsCssTextbox_ValidateHighlight
                , Layer02_Common.CheckSeriesDuplicate("uvw_Customer", "CustomerCode", this.mObj.GetKeys(), this.Txt_Code.Text)
                , "Duplicate Customer ID found. Please change the Customer ID. <br />");

            Int64     LookupClientTypeID = Convert.ToInt64(Do_Methods.IsNull(this.mObj.pDr["LookupClientTypeID"], 0));
            DataTable Dt = Do_Methods_Query.GetQuery("LookupClientType", "", "LookupClientTypeID = " + LookupClientTypeID.ToString());

            if (Dt.Rows.Count > 0)
            {
                DataRow Dr_ClientType = Dt.Rows[0];

                if ((bool)Do_Methods.IsNull(Dr_ClientType["IsCurrency"], false))
                {
                    Wc = this.Cbo_Currency;
                    Layer01_Methods_Web.Save_Validation(
                        ref Sb_Msg
                        , ref Wc
                        , ref IsValid
                        , Layer01_Constants_Web.CnsCssTextbox
                        , Layer01_Constants_Web.CnsCssTextbox_ValidateHighlight
                        , (Convert.ToInt64(this.Cbo_Currency.SelectedValue) == 0)
                        , "Currency is required. <br />");
                }

                if ((bool)Do_Methods.IsNull(Dr_ClientType["IsCreditCard_AccountName"], false))
                {
                    Wc = this.Txt_CreditCard_AccountName;
                    Layer01_Methods_Web.Save_Validation(
                        ref Sb_Msg
                        , ref Wc
                        , ref IsValid
                        , Layer01_Constants_Web.CnsCssTextbox
                        , Layer01_Constants_Web.CnsCssTextbox_ValidateHighlight
                        , (this.Txt_CreditCard_AccountName.Text == "")
                        , "Account Name is required. <br />");
                }

                if ((bool)Do_Methods.IsNull(Dr_ClientType["IsCreditCard"], false))
                {
                    bool Inner_IsValid = true;
                    this.Txt_CreditCard_Part1.CssClass = Layer01_Constants_Web.CnsCssTextbox;
                    this.Txt_CreditCard_Part2.CssClass = Layer01_Constants_Web.CnsCssTextbox;
                    this.Txt_CreditCard_Part3.CssClass = Layer01_Constants_Web.CnsCssTextbox;
                    this.Txt_CreditCard_Part4.CssClass = Layer01_Constants_Web.CnsCssTextbox;

                    if (this.Txt_CreditCard_Part1.Text.Trim() == "")
                    {
                        Inner_IsValid = false;
                    }
                    if (this.Txt_CreditCard_Part2.Text.Trim() == "")
                    {
                        Inner_IsValid = false;
                    }
                    if (this.Txt_CreditCard_Part3.Text.Trim() == "")
                    {
                        Inner_IsValid = false;
                    }
                    if (this.Txt_CreditCard_Part4.Text.Trim() == "")
                    {
                        Inner_IsValid = false;
                    }

                    if (!Inner_IsValid)
                    {
                        IsValid = false;
                        this.Txt_CreditCard_Part1.CssClass = Layer01_Constants_Web.CnsCssTextbox_ValidateHighlight;
                        this.Txt_CreditCard_Part2.CssClass = Layer01_Constants_Web.CnsCssTextbox_ValidateHighlight;
                        this.Txt_CreditCard_Part3.CssClass = Layer01_Constants_Web.CnsCssTextbox_ValidateHighlight;
                        this.Txt_CreditCard_Part4.CssClass = Layer01_Constants_Web.CnsCssTextbox_ValidateHighlight;
                        Sb_Msg.Append("Credit Card is required. <br />");
                    }
                }


                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 { }

                this.Txt_CreditCardExpiration_Month.CssClass = Layer01_Constants_Web.CnsCssTextbox;
                this.Txt_CreditCardExpiration_Year.CssClass  = Layer01_Constants_Web.CnsCssTextbox;

                if (!
                    (this.Txt_CreditCardExpiration_Month.Text.Trim() == "" ||
                     this.Txt_CreditCardExpiration_Year.Text.Trim() == ""))
                {
                    DateTime Inner_DateTime;
                    try
                    {
                        Inner_DateTime = new DateTime(CreditCardExpiration_Year, CreditCardExpiration_Month, 1);
                        if (Inner_DateTime < DateTime.Now)
                        {
                            IsValid = false;
                            this.Txt_CreditCardExpiration_Month.CssClass = Layer01_Constants_Web.CnsCssTextbox_ValidateHighlight;
                            this.Txt_CreditCardExpiration_Year.CssClass  = Layer01_Constants_Web.CnsCssTextbox_ValidateHighlight;
                            Sb_Msg.Append("Credit Card Date Expiry must be earlier than today. <br />");
                        }
                    }
                    catch
                    {
                        IsValid = false;
                        this.Txt_CreditCardExpiration_Month.CssClass = Layer01_Constants_Web.CnsCssTextbox_ValidateHighlight;
                        this.Txt_CreditCardExpiration_Year.CssClass  = Layer01_Constants_Web.CnsCssTextbox_ValidateHighlight;
                        Sb_Msg.Append("Credit Card Date Expiry is incorrect. <br />");
                    }
                }

                if ((bool)Do_Methods.IsNull(Dr_ClientType["IsCreditCard_Expiration"], false))
                {
                    if (this.Txt_CreditCardExpiration_Month.Text.Trim() == "" ||
                        this.Txt_CreditCardExpiration_Year.Text.Trim() == "")
                    {
                        IsValid = false;
                        this.Txt_CreditCardExpiration_Month.CssClass = Layer01_Constants_Web.CnsCssTextbox_ValidateHighlight;
                        this.Txt_CreditCardExpiration_Year.CssClass  = Layer01_Constants_Web.CnsCssTextbox_ValidateHighlight;
                        Sb_Msg.Append("Credit Card Date Expiry is required. <br />");
                    }
                }

                if ((bool)Do_Methods.IsNull(Dr_ClientType["IsPaymentTerm"], false))
                {
                    Wc = this.Cbo_PaymentTerm;
                    Layer01_Methods_Web.Save_Validation(
                        ref Sb_Msg
                        , ref Wc
                        , ref IsValid
                        , Layer01_Constants_Web.CnsCssTextbox
                        , Layer01_Constants_Web.CnsCssTextbox_ValidateHighlight
                        , (Convert.ToInt64(this.Cbo_PaymentTerm.SelectedValue) == 0)
                        , "Payment Term is required. <br />");
                }

                if ((bool)Do_Methods.IsNull(Dr_ClientType["IsTaxCode"], false))
                {
                    Wc = this.Cbo_TaxCode;
                    Layer01_Methods_Web.Save_Validation(
                        ref Sb_Msg
                        , ref Wc
                        , ref IsValid
                        , Layer01_Constants_Web.CnsCssTextbox
                        , Layer01_Constants_Web.CnsCssTextbox_ValidateHighlight
                        , (Convert.ToInt64(this.Cbo_TaxCode.SelectedValue) == 0)
                        , "Tax Code is required. <br />");
                }
            }

            return(IsValid);
        }
Example #28
0
 void SetupPage_Lookups()
 {
     Layer01_Methods_Web.BindCombo(ref this.Cbo_State, Do_Methods_Query.GetLookup("States"), "LookupID", "Desc", 0, "-Select-");
     Layer01_Methods_Web.BindCombo(ref this.Cbo_Country, Do_Methods_Query.GetLookup("Country"), "LookupID", "Desc", 0, "-Select-");
 }
        void SetupPage()
        {
            this.SetupPage_ControlAttributes();
            this.SetupPage_Lookups();

            //[-]

            this.Txt_ItemCode.Text = Do_Methods.Convert_String(this.mObj.pDr_RowProperty["Code"]);
            this.Txt_ItemName.Text = Do_Methods.Convert_String(this.mObj.pDr_RowProperty["Name"]);
            this.Txt_Remarks.Text  = Do_Methods.Convert_String(this.mObj.pDr_RowProperty["Remarks"]);
            this.Txt_Warranty.Text = Do_Methods.Convert_String(this.mObj.pDr["Warranty"]);

            this.Chk_IsSerial.Checked = Do_Methods.Convert_Boolean(this.mObj.pDr["IsSerial"]);

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

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

            this.Txt_EstimatedCost.Text = Do_Methods.Convert_Double(this.mObj.pDr["Cost"]).ToString("#,##0.00");
            this.Txt_ListPrice.Text     = Do_Methods.Convert_Double(this.mObj.pDr["Price"], 0).ToString("#,##0.00");

            bool IsImageFile = false;

            if ((string)Do_Methods.IsNull(this.mObj.pDr["Image_Path"], "") != "")
            {
                IsImageFile = true;
                System.IO.FileInfo Fi_Thumb =
                    new System.IO.FileInfo(
                        this.MapPath(Layer01_Constants_Web.CnsImageThumbPath
                                     + "Thumb_"
                                     + (string)Do_Methods.IsNull(this.mObj.pDr["Image_Path"], "")));
                if (!Fi_Thumb.Exists)
                {
                    try
                    {
                        Layer01_Methods_Web.ImageThumbnail(
                            this.MapPath(Layer01_Constants_Web.CnsImageThumbPath
                                         + (string)Do_Methods.IsNull(this.mObj.pDr["Image_Path"], ""))
                            , Fi_Thumb.FullName);
                    }
                    catch
                    { IsImageFile = false; }
                }

                this.Img_Box.ImageUrl      = Layer01_Constants_Web.CnsImageThumbPath + "Thumb_" + (string)Do_Methods.IsNull(this.mObj.pDr["Image_Path"], "");
                this.Btn_ViewImage.Visible = true;
            }

            if (!IsImageFile)
            {
                this.Img_Box.ImageUrl      = "~/System/Images/QuestionMark001.jpg";
                this.Btn_ViewImage.Visible = false;
            }

            if ((string)Do_Methods.IsNull(this.mObj.pDr["PdfDesc_Path"], "") == "")
            {
                this.Btn_PdfDesc.CssClass = Layer01_Constants_Web.CnsCssControlEnabledFalse;
                this.Btn_PdfDesc.Enabled  = false;
            }
            else
            {
                this.Btn_PdfDesc.CssClass = Layer01_Constants_Web.CnsCssControlEnabled;
                this.Btn_PdfDesc.Enabled  = true;
            }

            if ((string)Do_Methods.IsNull(this.mObj.pDr["PdfFaq_Path"], "") == "")
            {
                this.Btn_PdfFaq.CssClass = Layer01_Constants_Web.CnsCssControlEnabledFalse;
                this.Btn_PdfFaq.Enabled  = false;
            }
            else
            {
                this.Btn_PdfFaq.CssClass = Layer01_Constants_Web.CnsCssControlEnabled;
                this.Btn_PdfFaq.Enabled  = true;
            }

            if ((string)Do_Methods.IsNull(this.mObj.pDr["PdfOthers_Path"], "") == "")
            {
                this.Btn_PdfOther.CssClass = Layer01_Constants_Web.CnsCssControlEnabledFalse;
                this.Btn_PdfOther.Enabled  = false;
            }
            else
            {
                this.Btn_PdfOther.CssClass = Layer01_Constants_Web.CnsCssControlEnabled;
                this.Btn_PdfOther.Enabled  = true;
            }

            DataTable Dt_Defaults = Do_Methods_Query.GetQuery("uvw_Lookup");

            this.Cbo_Category.SelectedValue = ((Int64)Do_Methods.IsNull(this.mObj.pDr["LookupID_Category"], this.SetupPage_GetLookupDefault(Dt_Defaults, Layer01_Constants.eLookup.Category))).ToString();
            this.Cbo_ItemType.SelectedValue = ((Int64)Do_Methods.IsNull(this.mObj.pDr["LookupID_ItemType"], this.SetupPage_GetLookupDefault(Dt_Defaults, Layer01_Constants.eLookup.ItemType))).ToString();
            this.Cbo_Brand.SelectedValue    = ((Int64)Do_Methods.IsNull(this.mObj.pDr["LookupID_Brand"], this.SetupPage_GetLookupDefault(Dt_Defaults, Layer01_Constants.eLookup.Brand))).ToString();
            this.Cbo_Retailer.SelectedValue = ((Int64)Do_Methods.IsNull(this.mObj.pDr["LookupID_Category"], this.SetupPage_GetLookupDefault(Dt_Defaults, Layer01_Constants.eLookup.Retailer))).ToString();
            this.Cbo_ItemUOM.SelectedValue  = ((Int64)Do_Methods.IsNull(this.mObj.pDr["LookupID_ItemUOM"], this.SetupPage_GetLookupDefault(Dt_Defaults, Layer01_Constants.eLookup.UOM))).ToString();

            //[-]

            this.UcGrid_ItemPart.Setup(
                "Item_Part"
                , this.mObj.pDt_Part
                , "TmpKey"
                , false
                , true
                , this.mMaster.pIsReadOnly);
            this.UcGrid_ItemPart.pGrid.FullRowMode = false;

            this.UcGrid_ItemLocation.Setup(
                "Item_Location"
                , this.mObj.pDt_Location
                , "TmpKey"
                , false
                , true
                , this.mMaster.pIsReadOnly);
            this.UcGrid_ItemLocation.pGrid.FullRowMode = false;

            this.UcGrid_ItemSupplier.Setup(
                "Item_Supplier"
                , this.mObj.pDt_Supplier
                , "TmpKey"
                , false
                , true
                , this.mMaster.pIsReadOnly);
            this.UcGrid_ItemSupplier.pGrid.FullRowMode = false;

            DataTable Dt = Do_Methods_Query.GetQuery(
                "uvw_Materialized_InventoryWarehouse_Current_Item"
                , ""
                , "ItemID = " + Convert.ToInt64(Do_Methods.IsNull(this.mObj.pDr["ItemID"], 0)).ToString()
                , "WarehouseCodeName");

            this.mObj.AddRequired(Dt);
            this.UcGrid_OnHand.Setup("Item_Inventory", Dt);
            this.UcGrid_OnHand.pGrid.FullRowMode = false;
        }