Ejemplo n.º 1
0
        public void DDB()
        {
            DataTable TTB;
            string    TTstations = dbs.ExeSqlScalar("select stations from StationRole where UserID='" + Request.QueryString["Uid"].ToString() + "'");
            string    Nct        = dbs.ExeSqlScalar("select top 1 admin from StationRole where UserID='" + Session["UserID"].ToString() + "'").ToString();

            if (Nct == "1")
            {
                DataSet ds = DIMERCO.SDK.Utilities.LSDK.getStationHierarchy();
                //SqlConnection cn = new SqlConnection("Data Source=10.130.40.20;Initial Catalog=ReSM;User ID=sa;Password=dim1rc0@");
                //SqlDataAdapter da = new SqlDataAdapter("select distinct StationCode from SMStation order by StationCode", cn);
                //DataSet ds = new DataSet();
                //da.Fill(ds);
                TTB = ds.Tables[0];
            }
            else
            {
                string    Tstations = dbs.ExeSqlScalar("select stations from StationRole where UserID='" + Session["UserID"] + "'");
                DataTable Dt        = new DataTable();
                Dt.Columns.Add("StationCode");
                string[] Sp = Tstations.Split(',');
                for (int i = 0; i < Sp.Length; i++)
                {
                    if (Sp[i].ToString().Trim() != "")
                    {
                        DataRow newDr = Dt.NewRow();
                        newDr["StationCode"] = Sp[i].ToString();
                        Dt.Rows.Add(newDr);
                    }
                }
                TTB = Dt;
            }
            DataTable drnw = new DataTable();

            TTB.DefaultView.Sort = "StationCode ASC";
            drnw = TTB.DefaultView.ToTable();
            for (int i = 0; i < drnw.Rows.Count; i++)
            {
                Ext.Net.Checkbox C1 = new Ext.Net.Checkbox();
                C1.ID       = drnw.Rows[i]["StationCode"].ToString();
                C1.BoxLabel = drnw.Rows[i]["StationCode"].ToString();

                if (TTstations.Contains(drnw.Rows[i]["StationCode"].ToString() + ","))
                {
                    C1.Checked = true;
                }

                ChkGrp.Items.Add(C1);
            }
        }
Ejemplo n.º 2
0
        public void ShowDialog(int id)
        {
            ContentItem contentItem = Engine.Persister.Get(id);

            var window = new Window
            {
                ID = "pageCachingSettings",
                Title = @"Page Caching Settings",
                Width = 500,
                Height = 300,
                Layout = "fit",
                Modal = true
            };

            var formPanel = new FormPanel { Padding = 5 };
            var formLayout = new FormLayout();
            formPanel.ContentControls.Add(formLayout);
            window.Items.Add(formPanel);

            var chkEnableCache = new Checkbox
            {
                ID = "chkEnableCache",
                FieldLabel = @"Enable page cache?",
                LabelSeparator = "",
                Checked = contentItem.GetPageCachingEnabled()
            };
            formLayout.Anchors.Add(new Anchor(chkEnableCache));

            var tmeCacheDuration = new TimeField
            {
                ID = "tmeCacheDuration",
                FieldLabel = @"Cache duration",
                Width = 80,
                SelectedTime = contentItem.GetPageCachingDuration()
            };
            formLayout.Anchors.Add(new Anchor(tmeCacheDuration));

            Button btnSave = new Button { Text = @"Save" };
            window.Buttons.Add(btnSave);
            btnSave.Listeners.Click.Handler = string.Format(
                "stbStatusBar.showBusy(); Ext.net.DirectMethods.PageCaching.SavePageCachingSettings({0}, Ext.getCmp('{1}').getValue(), Ext.getCmp('{2}').getValue(), {{ url: '{4}', success: function() {{ stbStatusBar.setStatus({{ text: 'Saved page caching settings', iconCls: '', clear: true }}); }} }}); {3}.close();",
                id, chkEnableCache.ClientID, tmeCacheDuration.ClientID, window.ClientID, Engine.AdminManager.GetAdminDefaultUrl());

            Button btnCancel = new Button { Text = @"Cancel" };
            window.Buttons.Add(btnCancel);
            btnCancel.Listeners.Click.Handler = string.Format("{0}.close();", window.ClientID);

            window.Render(pnlContainer, RenderMode.RenderTo);
        }
Ejemplo n.º 3
0
        public void DDB()
        {
            DataSet Mds = dbs.GetSqlDataSet("select id,ModuleName from ModuleManage");

            for (int i = 0; i < Mds.Tables[0].Rows.Count; i++)
            {
                Ext.Net.Checkbox C1 = new Ext.Net.Checkbox();
                C1.ID       = Mds.Tables[0].Rows[i]["ID"].ToString();
                C1.BoxLabel = Mds.Tables[0].Rows[i]["ModuleName"].ToString();
                int Tct = int.Parse(dbs.ExeSqlScalar("select count(*) from StationRole where  UserID='" + Request.QueryString["Uid"].ToString() + "' and  charindex('," + Mds.Tables[0].Rows[i]["id"].ToString() + ",',ModuleID)>0"));
                if (Tct > 0)
                {
                    C1.Checked = true;
                }

                ChkGrp.Items.Add(C1);
            }
        }
Ejemplo n.º 4
0
        public override string XGetDesignTimeHtml()
        {
            StringWriter   writer     = new StringWriter(CultureInfo.CurrentCulture);
            HtmlTextWriter htmlWriter = new HtmlTextWriter(writer);

            Checkbox c = (Checkbox)this.Control;

            object[] args = new object[7];
            args[0] = c.ClientID;
            args[1] = c.Checked.ToString().ToLower();
            args[5] = c.StyleSpec;
            args[6] = "x-form-checkbox x-form-field " + c.ClearCls;

            LiteralControl ctrl = new LiteralControl(string.Format(this.Html, args));

            ctrl.RenderControl(htmlWriter);

            return(writer.ToString());
        }
Ejemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!X.IsAjaxRequest)
     {
         if (!IsPostBack)
         {
             SelectSoftType.SelectedItem.Value = "1";
             isSearch.Text = "1";
             platChecksGroup.Items.Clear();
             foreach (MobileOption platform in new MobileOption[] { MobileOption.iPhone, MobileOption.Android, MobileOption.IPAD })
             {
                 var check = new Ext.Net.Checkbox(false, platform.ToString());
                 check.RawValue = (int)platform;
                 check.Checked  = false;
                 check.ID       = "plat_" + (int)platform;
                 check.Width    = 90;
                 platChecksGroup.Items.Add(check);
             }
             btnSave.Disabled = true;
         }
     }
 }
Ejemplo n.º 6
0
 /// <summary>
 ///
 /// </summary>
 public Checkbox.Builder Checkbox(Checkbox component)
 {
     return(new Checkbox.Builder(component));
 }
Ejemplo n.º 7
0
    /// <summary>
    /// Lấy fieldname và giá trị
    /// </summary>
    /// <param name="control"></param>
    /// <param name="value"></param>
    /// <returns></returns>
    private string GetFieldName(Ext.Net.Component control, ref object value)
    {
        switch (control.ToString())
        {
        case "Ext.Net.TextField":
            Ext.Net.TextField txtControl = (Ext.Net.TextField)control;
            value = txtControl.Text;
            if (!txtControl.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(txtControl.ID.Substring(txtControl.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.Hidden":
            Ext.Net.Hidden hdfControl = (Ext.Net.Hidden)control;
            value = hdfControl.Text;
            if (!hdfControl.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(hdfControl.ID.Substring(hdfControl.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.Checkbox":
            Ext.Net.Checkbox chk = (Ext.Net.Checkbox)control;
            value = chk.Checked == true ? 1 : 0;
            if (!chk.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(chk.ID.Substring(chk.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.DateField":
            Ext.Net.DateField dfDate = (Ext.Net.DateField)control;
            if (!SoftCore.Util.GetInstance().IsDateNull(dfDate.SelectedDate))
            {
                value = dfDate.SelectedDate.Month + "/" + dfDate.SelectedDate.Day + "/" + dfDate.SelectedDate.Year;
            }
            else
            {
                value = "";
            }
            if (!dfDate.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(dfDate.ID.Substring(dfDate.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.NumberField":
            Ext.Net.NumberField nbf = (Ext.Net.NumberField)control;
            value = nbf.Text;
            if (!nbf.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(nbf.ID.Substring(nbf.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.ComboBox":
            Ext.Net.ComboBox cbBox = (Ext.Net.ComboBox)control;
            value = cbBox.SelectedItem.Value;
            if (!cbBox.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(cbBox.ID.Substring(cbBox.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.SpinnerField":
            Ext.Net.SpinnerField spinnerField = (Ext.Net.SpinnerField)control;
            value = spinnerField.Text;
            if (!spinnerField.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(spinnerField.ID.Substring(spinnerField.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.TextArea":
            Ext.Net.TextArea txtArea = (Ext.Net.TextArea)control;
            value = txtArea.Text;
            if (!txtArea.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(txtArea.ID.Substring(txtArea.ID.IndexOf("_") + 1));
            }

        case "Ext.Net.Container":
            Ext.Net.Container cContainer = (Ext.Net.Container)control;
            GetChildControl(cContainer);
            break;

        case "Ext.Net.FieldSet":
            Ext.Net.FieldSet fieldSet = (Ext.Net.FieldSet)control;
            GetChildControl(fieldSet);
            break;

        case "Ext.Net.HtmlEditor":
            Ext.Net.HtmlEditor htmlEditor = (Ext.Net.HtmlEditor)control;
            value = htmlEditor.Text;
            if (!htmlEditor.ID.Contains("_"))
            {
                return("");
            }
            else
            {
                return(htmlEditor.ID.Substring(htmlEditor.ID.IndexOf("_") + 1));
            }
        }
        return("");
    }
Ejemplo n.º 8
0
        private void InitComponents()
        {
            #region Header
            #region Button
            btnSave = new Button {
                ID = "btnSave", Icon = Icon.Disk, Text = "Save", ToolTip = "Save"
            };
            btnPost = new Button {
                ID = "btnPost", Icon = Icon.PackageAdd, Text = "Post Receive", ToolTip = "Post Receive"
            };
            topBar = new Toolbar {
                ID = "topBar", Items = { btnSave, btnPost }
            };
            #endregion Button

            #region Fields
            txtKey = new Hidden {
                DataIndex = "Key", Name = "Key", LabelWidth = 150, Anchor = "100%", FieldLabel = "Key", ID = "Key"
            };
            txtNo = new TextField {
                LabelWidth = 150, Anchor = "100%", FieldLabel = "No.", DataIndex = "No", Name = "No", ID = "txtNo", ReadOnly = true
            };
            txtBuy_from_Vendor_No = new TextField {
                LabelWidth = 150, Anchor = "100%", FieldLabel = "Buy-from Vendor No.", DataIndex = "Buy_from_Vendor_No", Name = "Buy_from_Vendor_No", ID = "txtBuy_from_Vendor_No", ReadOnly = true
            };
            txtBuy_from_Vendor_Name = new TextField {
                LabelWidth = 150, Anchor = "100%", FieldLabel = "Buy-from Vendor Name", DataIndex = "Buy_from_Vendor_Name", Name = "Buy_from_Vendor_Name", ID = "txtBuy_from_Vendor_Name", ReadOnly = true
            };
            txtOrder_Date = new DateField {
                LabelWidth = 150, FieldLabel = "Order Date", Anchor = "100%", Format = "dd/MM/yyyy", SubmitFormat = "dd/MM/yyyy", DataIndex = "Order_Date", Name = " Order_Date", SelectOnFocus = true, ID = "txtOrder_Date", ReadOnly = true
            };
            txtDocument_Date = new DateField {
                LabelWidth = 150, FieldLabel = "Document Date", Anchor = "100%", Format = "dd/MM/yyyy", SubmitFormat = "dd/MM/yyyy", DataIndex = "Document_Date", Name = " Document_Date", SelectOnFocus = true, ID = "txtDocument_Date", ReadOnly = true
            };
            txtPosting_Date = new DateField {
                LabelWidth = 150, FieldLabel = "Posting Date", Anchor = "100%", Format = "dd/MM/yyyy", SubmitFormat = "dd/MM/yyyy", DataIndex = "Posting_Date", Name = " Posting_Date", SelectOnFocus = true, ID = "txtPosting_Date", AllowBlank = false, MsgTarget = MessageTarget.Side
            };
            txtVietnamese_Desc = new TextField {
                LabelWidth = 150, FieldLabel = "Vietnamese Description", Anchor = "100%", DataIndex = "Vietnamese_Description", Name = " Vietnamese_Description", SelectOnFocus = true, ID = "txtVietnamese_Desc", AllowBlank = false, MsgTarget = MessageTarget.Side
            };
            txtVAT_Desc = new TextField {
                LabelWidth = 150, FieldLabel = "VAT Description", Anchor = "100%", DataIndex = "VAT_Description", Name = " VAT_Description", SelectOnFocus = true, ID = "txtVAT_Desc", AllowBlank = false, MsgTarget = MessageTarget.Side
            };
            cboReceive = new Checkbox {
                LabelWidth = 150, FieldLabel = "Receive", Anchor = "100%", DataIndex = "Receive", Name = " Receive", ID = "cboReceive"
            };
            #endregion Fields

            #region FormPanel
            frmHeader = new FormPanel
            {
                //Margins = "10 10 0 10",
                Region           = Region.North,
                Icon             = Ext.Net.Icon.ApplicationForm,
                Title            = "General",
                Border           = true,
                CollapseMode     = CollapseMode.Header,
                Collapsible      = true,
                ID               = "frmHeader",
                TrackResetOnLoad = true,
                Layout           = "Hbox",
                Items            =
                {
                    new Panel {
                        Layout             = "Anchor",
                        Flex               = 1,
                        BodyPaddingSummary = "10 10 0 10",
                        Border             = false,
                        Items              = { txtKey, txtNo,              txtBuy_from_Vendor_No, txtBuy_from_Vendor_Name, txtOrder_Date }
                    },
                    new Panel {
                        Layout             = "Anchor",
                        Flex               = 1,
                        BodyPaddingSummary = "10 10 0 10",
                        Border             = false,
                        Items              = { txtPosting_Date, txtVietnamese_Desc, txtVAT_Desc,  cboReceive }
                    }
                }
            };
            #endregion FormPanel
            #endregion Header

            #region Line
            #region GridLine
            dataTemplateLine = BuilDataTemplateLine();
            grdLine          = new GridPanelEditBase
            {
                ID           = "grdLine",
                Border       = false,
                TitleAlign   = Ext.Net.TitleAlign.Center,
                ProxyUrl     = @"..//..//..//..//PurchaseOrder//SvcPurchaseOrder.asmx/GetPOLine",
                DocumentType = "",
                DocumentNo   = DocumentNo,
                CurCompany   = GlobalVariable.CompanyName,
                SCOPE        = this.SCOPE,
                DataTemplate = dataTemplateLine,
            };
            #endregion GridLine

            #region pnlLine
            pnlLine = new Panel
            {
                ID     = "pnlLine",
                Region = Ext.Net.Region.Center,
                Layout = "Fit",
                Icon   = Ext.Net.Icon.Group,
                Title  = "Lines",
                Border = true,
                //Margins = "10 10 5 10",
                Split = true,
                Items = { grdLine }
            };
            #endregion pnlLine
            #endregion Line

            #region Windows
            this.ID          = "winCard";
            this.Maximizable = false;
            this.Minimizable = false;
            this.CloseAction = CloseAction.Destroy;
            this.Icon        = Icon.ApplicationEdit;
            this.TopBar.Add(topBar);
            this.Layout = "Border";
            this.Items.AddRange(new ItemsCollection <Ext.Net.AbstractComponent> {
                this.frmHeader, this.pnlLine
            });
            #endregion Windows
        }
        private string _Get_Column_Value(string[] sel, DataRow selrow)
        {
            string rtn_str = "";

            for (int i = 1; i < sel.Length; i++)
            {
                string colName = sel[i];
                if (colName.Equals("info_date"))
                {
                    rtn_str = selrow[colName].ToString() + "、";
                }
                if (colName.Equals("section"))
                {
                    rtn_str = selrow[colName].ToString() + "、";
                }
                if (colName.Equals("bed_no"))
                {
                    rtn_str = selrow[colName].ToString() + "、";
                }
                else
                {
                    switch (colName.Substring(0, 3))
                    {
                    case "dat":
                        rtn_str += selrow[colName].ToString() + "、";
                        break;

                    case "txt":
                        rtn_str += selrow[colName].ToString() + "、";
                        break;

                    case "are":
                        rtn_str += selrow[colName].ToString() + "、";
                        break;

                    case "num":
                        rtn_str += selrow[colName].ToString() + "、";
                        break;

                    case "cbo":
                        break;

                    case "opt":
                        string optVal = selrow[colName].ToString();
                        string optsel = colName + "_" + optVal.ToString();
                        if (_haTable.ContainsKey(optsel))
                        {
                            Ext.Net.Radio radio = (Ext.Net.Radio)_objTable[optsel];
                            rtn_str += radio.BoxLabel + "、";
                        }
                        break;

                    case "chk":
                        string chkVal = selrow[colName].ToString();
                        for (int x = 1; x <= chkVal.Length; x++)
                        {
                            if (chkVal.Substring(x - 1, 1).Equals("1"))
                            {
                                string chksel = colName + "_" + x.ToString();
                                if (_haTable.ContainsKey(chksel))
                                {
                                    Ext.Net.Checkbox checkbox = (Ext.Net.Checkbox)_objTable[chksel];
                                    rtn_str += checkbox.BoxLabel + "、";
                                }
                            }
                        }
                        break;
                    }
                }
            }

            if (rtn_str.Length > 0)
            {
                rtn_str = rtn_str.Substring(0, rtn_str.Length - 1);
            }
            return(rtn_str);
        }
Ejemplo n.º 10
0
        private void InitComponents()
        {
            #region Button and Toolbar
            bool display = (Status == "Open" || Status == "") ? true : false;
            btnSave = new Button {
                ID = "btnSave", Icon = Icon.Disk, Text = "Lưu", ToolTip = "Save", Visible = display
            };
            btnDeleteCard = new Button {
                ID = "btnDeleteCard", Icon = Icon.Delete, Text = "Xóa", ToolTip = "Delete", Visible = display
            };
            topBar = new Toolbar {
                ID = "topBar", Items = { btnSave, btnDeleteCard }, Visible = display
            };
            #endregion Button and Toolbar
            #region Batch and Key
            txtBatch = new Ext.Net.Hidden {
                Name = "Batch", LabelWidth = 150, Anchor = "100%", FieldLabel = "Batch", ID = "txtBatch"
            };
            txtKey = new Ext.Net.Hidden {
                DataIndex = "UID", Name = "UID", LabelWidth = 150, Anchor = "100%", FieldLabel = "UID", ID = "txtKey"
            };
            #endregion Batch and Key
            #region cboNo
            cboNo = new ComboBoxLookup
            {
                DataIndex     = "No",
                Name          = "No",
                LabelWidth    = 150,
                Anchor        = "100%",
                FieldLabel    = "No.",
                ID            = "cboNo",
                SelectOnFocus = true,
                AllowBlank    = false,
                MsgTarget     = MessageTarget.Side,
                ProxyUrl      = "../../../Handler/ItemListHandler.ashx",
                DataTemplete  =
                {
                    new LookupFormatData {
                        FieldName = "No", FieldTitle = "No.", ColWidth = 100
                    },
                    new LookupFormatData {
                        FieldName = "Description", FieldTitle = "Description", ColWidth = 250
                    },
                    new LookupFormatData {
                        FieldName = "Base_Unit_of_Measure", FieldTitle = "Base Unit of Measure", ColWidth = 150
                    },
                    new LookupFormatData {
                        FieldName = "Unit_Cost", FieldTitle = "Unit Cost", ColWidth = 120
                    }
                },
                idProperty   = "No",
                DisplayField = "No",
                ValueField   = "No",
                PageSize     = 100,
                CurCompany   = GlobalVariable.CompanyName,
                SCOPE        = "GLX.Lookup.ItemNo"
            };
            #endregion cboNo
            #region cboType
            cboType = new ComboBox
            {
                DataIndex     = "Type",
                Name          = "Type",
                LabelWidth    = 150,
                Anchor        = "100%",
                FieldLabel    = "Type",
                ID            = "cboType",
                SelectOnFocus = true,
                AllowBlank    = false,
                ReadOnly      = true,
                Items         =
                {
                    new ListItem {
                        Text = "G/L Account", Value = "G/L Account"
                    },
                    new ListItem {
                        Text = "Item", Value = "Item"
                    },
                }
            };
            #endregion cboType
            #region cboAction_Message
            cboAction_Message = new ComboBox {
                DataIndex = "Action_Message", Name = "Action_Message", LabelWidth = 150, Anchor = "100%", FieldLabel = "Action Message", ID = "cboAction_Message", SelectOnFocus = true, ReadOnly = true,
                //Items = {
                //    new ListItem {Text="", Value="" },
                //    new ListItem {Text="New", Value="New" },
                //    new ListItem {Text="Change Qty.", Value="Change Qty." },
                //    new ListItem {Text="Reschedule", Value="Reschedule" },
                //    new ListItem {Text="Resched. & Chg. Qty.", Value="Resched. & Chg. Qty." },
                //    new ListItem {Text="Cancel", Value="Cancel" },
                //}
                Store =
                {
                    new Store                      {
                        Data  = ActionMessage, AutoDataBind = true,
                        Model =
                        {
                            new Model              {
                                Fields =
                                {
                                    new ModelField {
                                        Name = "value"
                                    },
                                    new ModelField {
                                        Name = "text"
                                    },
                                    new ModelField {
                                        Name = "displaytext"
                                    }
                                }
                            }
                        }
                    }
                }
            };
            #endregion cboAction_Message
            #region Accept Action Message and Description
            cboAccept_Action_Message = new Checkbox
            {
                DataIndex  = "Accept_Action_Message",
                Name       = "Accept_Action_Message",
                LabelWidth = 150,
                Anchor     = "100%",
                FieldLabel = "Accept Action Message",
                ID         = "cboAccept_Action_Message",
                ReadOnly   = true
            };
            txtDescription = new TextField
            {
                DataIndex  = "Description",
                Name       = "Description",
                LabelWidth = 150,
                Anchor     = "100%",
                FieldLabel = "Description",
                ID         = "txtDescription",
                ReadOnly   = true
            };
            txtRemark = new TextField
            {
                DataIndex  = "Remark",
                Name       = "Remark",
                LabelWidth = 150,
                Anchor     = "100%",
                FieldLabel = "Remark",
                ID         = "txtRemark",
                ReadOnly   = false
            };
            #endregion Accept Action Message and Description
            #region cboLocation_Code
            cboLocation_Code = new ComboBoxLookup
            {
                DataIndex     = "Location_Code",
                Name          = "Location_Code",
                LabelWidth    = 150,
                Anchor        = "100%",
                FieldLabel    = "Location Code",
                ID            = "cboLocation_Code",
                SelectOnFocus = true,
                AllowBlank    = true,
                MsgTarget     = MessageTarget.Side,
                ProxyUrl      = "../../../Handler/LocationListHandler.ashx",
                DataTemplete  =
                {
                    new LookupFormatData {
                        FieldName = "Code", FieldTitle = "Code", ColWidth = 100
                    },
                    new LookupFormatData {
                        FieldName = "Name", FieldTitle = "Name", ColWidth = 150
                    }
                },
                idProperty   = "Code",
                DisplayField = "Code",
                ValueField   = "Code",
                PageSize     = 100,
                CurCompany   = GlobalVariable.CompanyName,
                SCOPE        = "GLX.Lookup.Location"
            };
            #endregion cboLocation_Code
            #region Original_Quantity and Quantity
            txtOriginal_Quantity = new NumberField
            {
                DataIndex  = "Original_Quantity",
                Name       = "Original_Quantity",
                LabelWidth = 150,
                Anchor     = "100%",
                FieldLabel = "Original Quantity",
                ID         = "txtOriginal_Quantity",
                MinValue   = 0,
                MaxValue   = 1000000,
                ReadOnly   = true
            }; //1.000.000
            txtQuantity = new TextField
            {
                DataIndex  = "Quantity",
                Name       = "Quantity",
                LabelWidth = 150,
                Anchor     = "100%",
                FieldLabel = "Quantity",
                ID         = "txtQuantity",
                MaskRe     = @"/[0-9\.]/",
            };
            #endregion Original_Quantity and Quantity
            #region cboUnit_of_Measure_Code
            cboUnit_of_Measure_Code = new ComboBoxLookup
            {
                DataIndex     = "Unit_of_Measure_Code",
                Name          = "Unit_of_Measure_Code",
                LabelWidth    = 150,
                Anchor        = "100%",
                FieldLabel    = "Unit of Measure Code",
                ID            = "cboUnit_of_Measure_Code",
                SelectOnFocus = true,
                AllowBlank    = false,
                MsgTarget     = MessageTarget.Side,
                ProxyUrl      = "../../../Handler/UOMHandler.ashx",
                DataTemplete  =
                {
                    new LookupFormatData {
                        FieldName = "Code", FieldTitle = "Code", ColWidth = 100
                    },
                    new LookupFormatData {
                        FieldName = "Description", FieldTitle = "Description", ColWidth = 150
                    },
                    new LookupFormatData {
                        FieldName = "Qty_per_Unit_of_Measure", FieldTitle = "Qty per Unit of Measure", ColWidth = 150
                    }
                },
                idProperty   = "Code",
                DisplayField = "Code",
                ValueField   = "Code",
                PageSize     = 100,
                CurCompany   = GlobalVariable.CompanyName,
                SCOPE        = "GLX.Lookup.UOM"
            };
            #endregion txtUnit_of_Measure_Code
            #region Direct_Unit_Cost and Due_Date
            txtDirect_Unit_Cost = new TextField
            {
                DataIndex  = "Direct_Unit_Cost",
                Name       = "txtDirect_Unit_Cost",
                LabelWidth = 150,
                Anchor     = "100%",
                FieldLabel = "Direct Unit Cost",
                ID         = "txtDirect_Unit_Cost",
                ReadOnly   = true
            };
            txtDue_Date = new DateField
            {
                DataIndex    = "Due_Date",
                Name         = "Due_Date",
                LabelWidth   = 150,
                Anchor       = "100%",
                FieldLabel   = "Due Date",
                ID           = "txtDue_Date",
                Format       = "dd/MM/yyyy",
                SubmitFormat = "dd/MM/yyyy"
            };
            #endregion Direct_Unit_Cost and Due_Date
            #region cboVendor_No
            cboVendor_No = new ComboBoxLookup {
                DataIndex    = "Vendor_No", Name = "Vendor_No", LabelWidth = 150, Anchor = "100%", FieldLabel = "Vendor No.", ID = "cboVendor_No", ReadOnly = true,
                AllowBlank   = true,
                MsgTarget    = MessageTarget.Side,
                ProxyUrl     = "../../../Handler/ItemVendorCatalogHandler.ashx",
                DataTemplete =
                {
                    new LookupFormatData {
                        FieldName = "Vendor_No", FieldTitle = "Vendor No", ColWidth = 100
                    },
                    new LookupFormatData {
                        FieldName = "Vendor_Item_No", FieldTitle = "Vendor Item No.", ColWidth = 100
                    },
                    new LookupFormatData {
                        FieldName = "Lead_Time_Calculation", FieldTitle = "Lead Time Calculation", ColWidth = 150
                    }
                },
                idProperty   = "Vendor_No",
                DisplayField = "Vendor_No",
                ValueField   = "Vendor_No",
                PageSize     = 100,
                CurCompany   = GlobalVariable.CompanyName,
                SCOPE        = "GLX.Lookup.ItemVendorCatalog"
            };
            #endregion cboVendor_No
            #region cboUOMHandler
            //cboUOMHandler = new ComboBoxLookup {
            //    DataIndex = "Unit_of_Measure_Code",
            //    Name = "Unit_of_Measure_Code",
            //    LabelWidth = 150,
            //    Anchor = "100%",
            //    FieldLabel = "UOM",
            //    ID = "cboUOMHandler",
            //    ReadOnly = false,
            //    AllowBlank = false,
            //    MsgTarget = MessageTarget.Side,
            //    ProxyUrl = "../../../Handler/UOMHandler.ashx",
            //    DataTemplete = {
            //        new LookupFormatData{FieldName = "Code", FieldTitle = "Code", ColWidth = 100},
            //        new LookupFormatData{FieldName = "Description", FieldTitle = "Description", ColWidth = 100},
            //        new LookupFormatData{FieldName = "Qty_per_Unit_of_Measure", FieldTitle = "Qty per Unit of Measure", ColWidth = 200, Format="N0"},
            //    },
            //    idProperty = "Unit_of_Measure_Code",
            //    DisplayField = "Unit_of_Measure_Code",
            //    ValueField = "Unit_of_Measure_Code",
            //    PageSize = 5,
            //    CurCompany = GlobalVariable.CompanyName,
            //    SCOPE = "GLX.Lookup.UOM"
            //};
            //cboUOMHandler.Store.Primary.Parameters.AddRange(new Ext.Net.StoreParameter[] {
            //    new Ext.Net.StoreParameter{Name = "type", Value = String.Format("2|3"), Mode = ParameterMode.Value},
            //});
            #endregion cboUOMHandler
            #region Vendor_Item_No
            txtVendor_Item_No = new TextField
            {
                DataIndex  = "Vendor_Item_No",
                Name       = "Vendor_Item_No",
                LabelWidth = 150,
                Anchor     = "100%",
                FieldLabel = "Vendor Item No",
                ID         = "txtVendor_Item_No",
                ReadOnly   = true
            };
            #endregion Vendor_Item_No
            #region cboReplenishment_System
            cboReplenishment_System = new ComboBox
            {
                DataIndex  = "Replenishment_System",
                Name       = "Replenishment_System",
                LabelWidth = 150,
                Anchor     = "100%",
                FieldLabel = "Replenishment System",
                ID         = "cboReplenishment_System",
                ReadOnly   = true,
                Store      =
                {
                    new Store                      {
                        Data  = ReplenishmentSystem, AutoDataBind = true,
                        Model =
                        {
                            new Model              {
                                Fields =
                                {
                                    new ModelField {
                                        Name = "value"
                                    },
                                    new ModelField {
                                        Name = "text"
                                    },
                                    new ModelField {
                                        Name = "displaytext"
                                    }
                                }
                            }
                        }
                    }
                }

                //Items = {
                //    new ListItem { Text="Purchase", Value="Purchase"},
                //    new ListItem { Text="Prod. Order", Value="Prod. Order"},
                //    new ListItem { Text="Transfer", Value="Transfer"},
                //    new ListItem { Text="Assembly", Value="Assembly"}
                //}
            };
            #endregion cboReplenishment_System
            #region cboNo
            cboNo = new ComboBoxLookup
            {
                DataIndex     = "No",
                Name          = "No",
                LabelWidth    = 150,
                Anchor        = "100%",
                FieldLabel    = "No.",
                ID            = "cboNo",
                SelectOnFocus = true,
                AllowBlank    = false,
                MsgTarget     = MessageTarget.Side,
                ProxyUrl      = "../../../Handler/ItemListHandler.ashx",
                DataTemplete  =
                {
                    new LookupFormatData {
                        FieldName = "No", FieldTitle = "No.", ColWidth = 100
                    },
                    new LookupFormatData {
                        FieldName = "Description", FieldTitle = "Description", ColWidth = 250
                    },
                    new LookupFormatData {
                        FieldName = "Base_Unit_of_Measure", FieldTitle = "Base Unit of Measure", ColWidth = 150
                    },
                    new LookupFormatData {
                        FieldName = "Unit_Cost", FieldTitle = "Unit Cost", ColWidth = 120
                    }
                },
                idProperty   = "No",
                DisplayField = "No",
                ValueField   = "No",
                PageSize     = 100,
                CurCompany   = GlobalVariable.CompanyName,
                SCOPE        = "GLX.Lookup.ItemNo"
            };
            #endregion cboNo


            TextAreaChangeLogComment = new TextArea {
                Flex = 1, ID = "TextAreaChangeLogComment", ReadOnly = true
            };
            hiddenConverted = new Ext.Net.Hidden {
                DataIndex = "Converted", Name = "Converted", ID = "hiddenConverted"
            };
            hiddenStatus = new Ext.Net.Hidden {
                DataIndex = "Status", Name = "Status", ID = "hiddenStatus"
            };

            #region frmHeader
            frmHeader = new FormPanel
            {
                Header           = false,
                Region           = Region.North,
                Icon             = Ext.Net.Icon.ApplicationForm,
                Border           = true,
                ID               = "frmHeader",
                TrackResetOnLoad = true,
                Layout           = "Hbox",
                Items            =
                {
                    new Panel {
                        Layout             = "Anchor",
                        Flex               = 1,
                        BodyPaddingSummary = "10 10 10 10",
                        Border             = false,
                        //Items = { txtKey, txtBatch, cboType, cboNo, cboAction_Message, cboAccept_Action_Message, txtDescription, cboLocation_Code } //txtOriginal_Quantity
                        Items ={ txtKey,                    txtBatch,            hiddenConverted,  hiddenStatus, cboNo, txtDescription, txtRemark,
                                cboUnit_of_Measure_Code, txtDirect_Unit_Cost, cboLocation_Code, txtQuantity,  txtDue_Date }//txtOriginal_Quantity, cboType, cboAction_Message, cboAccept_Action_Message,
                    },
                }
            };
            frmComment = new FormPanel
            {
                ID     = "frmComment",
                Title  = "Comment",
                Icon   = Icon.Comments,
                Border = false,
                Region = Region.South,
                Layout = "Fit",
                Height = 150,
                Items  = { TextAreaChangeLogComment }
            };

            #endregion frmHeader

            #region Windows
            this.ID          = "winCard";
            this.Maximizable = false;
            this.Minimizable = false;
            this.CloseAction = CloseAction.Destroy;
            this.Icon        = Icon.ApplicationEdit;
            this.TopBar.Add(topBar);
            this.Layout = "Border";
            this.Items.AddRange(
                new ItemsCollection <Ext.Net.AbstractComponent>
            {
                this.frmHeader, frmComment
            }
                );
            #endregion Windows
        }
Ejemplo n.º 11
0
        public void DDB()
        {
       

           DataSet Mds = dbs.GetSqlDataSet("select id,ModuleName from ModuleManage");

           for (int i = 0; i < Mds.Tables[0].Rows.Count; i++)
           {
               Ext.Net.Checkbox C1 = new Ext.Net.Checkbox();
               C1.ID = Mds.Tables[0].Rows[i]["ID"].ToString();
               C1.BoxLabel = Mds.Tables[0].Rows[i]["ModuleName"].ToString();
               int Tct=int.Parse(dbs.ExeSqlScalar("select count(*) from StationRole where  UserID='" + Request.QueryString["Uid"].ToString() + "' and  charindex('," +  Mds.Tables[0].Rows[i]["id"].ToString() + ",',ModuleID)>0"));
               if (Tct > 0)
               {
                   C1.Checked = true;
               }

               ChkGrp.Items.Add(C1);
           }
                
        }
Ejemplo n.º 12
0
        public void DDB()
        {
            DataTable TTB;
            string TTstations = dbs.ExeSqlScalar("select stations from StationRole where UserID='" + Request.QueryString["Uid"].ToString() + "'");
            string Nct = dbs.ExeSqlScalar("select top 1 admin from StationRole where UserID='" + Session["UserID"].ToString() + "'").ToString();
        if (Nct == "1")
        {
            DataSet ds = DIMERCO.SDK.Utilities.LSDK.getStationHierarchy();
            //SqlConnection cn = new SqlConnection("Data Source=10.130.40.20;Initial Catalog=ReSM;User ID=sa;Password=dim1rc0@");
            //SqlDataAdapter da = new SqlDataAdapter("select distinct StationCode from SMStation order by StationCode", cn);
            //DataSet ds = new DataSet();
            //da.Fill(ds);
            TTB = ds.Tables[0];
        }
        else
        {
            string Tstations = dbs.ExeSqlScalar("select stations from StationRole where UserID='" + Session["UserID"] + "'");
            DataTable Dt = new DataTable();
            Dt.Columns.Add("StationCode");
            string[] Sp = Tstations.Split(',');
            for (int i = 0; i < Sp.Length; i++)
            {
                if (Sp[i].ToString().Trim() != "")
                {
                    DataRow newDr = Dt.NewRow();
                    newDr["StationCode"] = Sp[i].ToString();
                    Dt.Rows.Add(newDr);
                }
            }
            TTB = Dt;
           
        }
        DataTable drnw = new DataTable();
        TTB.DefaultView.Sort = "StationCode ASC";
        drnw = TTB.DefaultView.ToTable();
        for (int i = 0; i < drnw.Rows.Count; i++)
            {
                Ext.Net.Checkbox C1 = new Ext.Net.Checkbox();
                C1.ID = drnw.Rows[i]["StationCode"].ToString();
                C1.BoxLabel = drnw.Rows[i]["StationCode"].ToString();

                if (TTstations.Contains(drnw.Rows[i]["StationCode"].ToString()+","))
                {
                    C1.Checked = true;
                }
             
                ChkGrp.Items.Add(C1);
            }
        }