Пример #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            IBOrderTrackingEntities oConection = new IBOrderTrackingEntities();

            if (Session["SO"] != null)
            {
                string   mSO     = Session["SO"].ToString();
                SOHeader oHeader = oConection.SOHeaders.SingleOrDefault(x => x.SO.Equals(mSO));


                oHeader.PO     = txtPO.Value;
                oHeader.DocAWB = txtDocAWB.Value;
                //oHeader.TTSlip = txtTTSlip.
                //if (!String.IsNullOrEmpty(txtTTSlip.Value))
                //{
                //    var oDate = Nullable<DateTime>.Parse(txtTTSlip.Value);

                //}

                //if (!string.IsNullOrEmpty(txtTTSlip.Value))

                //{
                //    DateTime?.Parse.txtTTSlip();
                //}

                oConection.SaveChanges();


                divSave.Attributes.Remove("hidden");
                divSave.InnerText = "Save Success";
            }
        }
Пример #2
0
        protected void GetSOHeaderByID(string strSO)
        {
            IBOrderTrackingEntities oConnect = new IBOrderTrackingEntities();

            SOHeader oHeader = oConnect.SOHeaders.SingleOrDefault(x => x.SO.Equals(strSO));

            if (oHeader != null)
            {
                SetObjectValue(oHeader);
            }
        }
Пример #3
0
        private void GenerateTable()
        {
            //Header
            //Add header to table
            TableRow oRow = new TableRow();

            oRow.TableSection = TableRowSection.TableHeader;

            int noCol = 0;

            foreach (var item in getSOHeader())
            {
                if (noCol < 9)
                {
                    TableCell oH1 = new TableCell();
                    oH1.Text = item;
                    oRow.Cells.Add(oH1);
                }
                noCol++;
            }
            //Finish Header
            tblData.Rows.Add(oRow);

            //Rows
            WebIBOST1.IBOrderTrackingEntities oConnect = new IBOrderTrackingEntities();
            if (oConnect.SOHeaders.Count() > 0)
            {
                var soItem = oConnect.SOHeaders.ToList();

                foreach (var row in soItem)
                {
                    noCol = 0;
                    //Add Detail to table
                    TableRow oDetail = new TableRow();
                    oDetail.TableSection = TableRowSection.TableBody;

                    Type           oType = row.GetType();
                    PropertyInfo[] props = oType.GetProperties();
                    foreach (var prop in props)
                    {
                        //Row 1 Col 1
                        if (noCol < 9)
                        {
                            TableCell oR1 = new TableCell();
                            if (prop.Name == "SO")
                            {
                                oR1.Text = prop.GetValue(row) != null?SetLinkSOUrl(prop.GetValue(row).ToString()) : "'/>";
                            }
                            else if (prop.Name == "PO")
                            {
                                oR1.Text = prop.GetValue(row) != null?SetLinkPOUrl(prop.GetValue(row).ToString()) : "'/>";
                            }
                            else
                            {
                                oR1.Text = prop.GetValue(row) != null?prop.GetValue(row).ToString() : "";
                            }

                            oDetail.Cells.Add(oR1);
                        }
                        noCol++;
                    }
                    // Finish 1 Row
                    tblData.Rows.Add(oDetail);
                }


                // Add class
                tblData.Attributes.Add("class", "table table-striped table-bordered table-hover");
            }
        }