示例#1
0
        private bool Validation()
        {
            bool _RetVal = false;

            try
            {
                if (txtSiteCode_Site.Value.ToString().Trim().Replace("'", "") == "")
                {
                    //txtCode_Student.Value = oCommonEngine.GetAutoGenerateCode(strUserCode, strSiteCode, "Student");
                }
                if (txtSiteCode_Site.Value.ToString().Trim().Replace("'", "") == "")
                {
                    oCommonEngine.SetAlert(this.Page, "Please enter Site Code...!", Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Short);
                    return(_RetVal);
                }
                if (txtSiteDesc_Site.Value.ToString().Trim().Replace("'", "") == "")
                {
                    oCommonEngine.SetAlert(this.Page, "Please enter Site Description...!", Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Short);
                    return(_RetVal);
                }
                //if (txtPostCode_Site.Value.ToString().Trim().Replace("'", "") == "")
                //{
                //    oCommonEngine.SetAlert(this.Page, "Please enter PostCode...!", Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Short);
                //    return _RetVal;
                //}

                _RetVal = true;
                return(_RetVal);
            }
            catch (Exception Ex)
            {
                oCommonEngine.SetAlert(this.Page, Ex.Message, Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Short);
                return(_RetVal);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    Get_ControlNo_Prefixs();
                }

                Get_AgeGroup();
                Get_Race();
                Get_SkinType();
                Get_Language();
                Get_Locations();
                Get_CorporateCustomer();
                Get_Sources();
                Get_OccupationTypes();

                if (Request.QueryString["PKey"] != null)
                {
                    CollapsiblePanelCorporateCustomer.Collapsed = false;
                    oCommonEngine.SetAlert(this.Page, "Customer Updated Successfully..!", Utilities.CommonEngine.MessageType.Success, Utilities.CommonEngine.MessageDuration.Short);
                }
            }
            catch (Exception Ex)
            {
                oCommonEngine.SetAlert(this.Page, Ex.Message, Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Medium);
            }
        }
示例#3
0
        private void LoadPageInformations(string _PKey1)
        {
            try
            {
                HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create(string.Format(System.Configuration.ConfigurationManager.AppSettings["uri"] + "api/PoPrintLists"));
                WebReq.Method = "GET";
                HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();
                Console.WriteLine(WebResp.StatusCode);
                Console.WriteLine(WebResp.Server);
                string jsonString;
                using (Stream stream = WebResp.GetResponseStream())
                {
                    StreamReader reader = new StreamReader(stream, System.Text.Encoding.UTF8);
                    jsonString = reader.ReadToEnd();
                }
                oDT_Header = (DataTable)JsonConvert.DeserializeObject(jsonString, (typeof(DataTable)));
                if (_PKey1 != "")
                {
                    DataView oDV = new DataView(oDT_Header);
                    oDV.RowFilter = "poNo='" + _PKey1 + "'";
                    oDT_Header    = oDV.ToTable();
                }

                //oDT_Header = (DataTable)JsonConvert.DeserializeObject(jsonString, (typeof(DataTable)));
                ReportDataSource rds = new ReportDataSource("ds_PORequest", oDT_Header);
                this.rv_webBI_InvoicePrint.LocalReport.DataSources.Clear();
                this.rv_webBI_InvoicePrint.LocalReport.DataSources.Add(rds);

                string strFromDate    = "";
                string strToDate      = "";
                string postData1Title = "{\"fromDate\":\"" + strFromDate.Trim() + "\"," +
                                        "\"toDate\":\"" + strToDate.Trim() + "\"," +
                                        //"\"ReportTitle\":\"" + "Sales Collection" + "\"," +
                                        "\"ReportTitle\":\"" + " Invoice Print " + "\"," +
                                        "\"site\":\"" + System.Configuration.ConfigurationManager.AppSettings["SiteCode"].ToString() + "\"}";
                //oDT_GeneralTitle = oCommonEngine.GetDataTableFromAPI(Login.strAPIURL + "/api/webBI_ReportTittle", postData1Title);
                oDT_GeneralTitle = oCommonEngine.ExecuteDataTable("select '' as fromDate,'' as toDate ,'Goods Receive Note Print' as reportTitle,'' as site ,'' as userCode,'' as siteText, Comp_Title1 as companyHeader1,Comp_Title2 as companyHeader2,Comp_Title3 as companyHeader3,Comp_Title4 as companyHeader4,Footer_1 as companyFooter1,Footer_2 as companyFooter2,Footer_3 as companyFooter3,Footer_4 as companyFooter4 from Title where Product_License='" + oDT_Header.Rows[0]["itemSiteCode"] + "'");
                ReportDataSource titledatasource = new ReportDataSource("ds_webBI_ReportTittle", oDT_GeneralTitle);
                this.rv_webBI_InvoicePrint.LocalReport.DataSources.Add(titledatasource);

                oDT_Logo = oCommonEngine.ExecuteDataTable("select Trans_Logo as Logo from Title  ");
                ReportDataSource Logodatasource = new ReportDataSource("ds_Logo", oDT_Logo);
                this.rv_webBI_InvoicePrint.LocalReport.DataSources.Add(Logodatasource);

                this.rv_webBI_InvoicePrint.LocalReport.ReportPath = "rpt_webBI_Invoice.rdlc";
                this.rv_webBI_InvoicePrint.LocalReport.Refresh();
                this.rv_webBI_InvoicePrint.SizeToReportContent = true;
                this.rv_webBI_InvoicePrint.Width          = Unit.Percentage(100);
                this.rv_webBI_InvoicePrint.Height         = Unit.Percentage(100);
                this.rv_webBI_InvoicePrint.AsyncRendering = false;
                this.rv_webBI_InvoicePrint.ZoomMode       = ZoomMode.FullPage;
                oCommonEngine.SetAlert(this.Page, "Report Loaded Sucessfully...!", Utilities.CommonEngine.MessageType.Success, Utilities.CommonEngine.MessageDuration.Short);
            }
            catch (Exception Ex)
            {
                oCommonEngine.SetAlert(this.Page, Ex.Message, Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Medium);
                throw;
            }
        }
示例#4
0
        private bool Validation()
        {
            bool _RetVal = false;

            try
            {
                if (txtCode_PayGroup.Value.ToString().Trim().Replace("'", "") == "")
                {
                    oCommonEngine.SetAlert(this.Page, "Please enter Payment Group...!", Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Short);
                    return(_RetVal);
                }
                if (txtSqe_PayGroup.Value.ToString().Trim().Replace("'", "") == "")
                {
                    oCommonEngine.SetAlert(this.Page, "Please enter Sequence...!", Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Short);
                    return(_RetVal);
                }

                _RetVal = true;
                return(_RetVal);
            }
            catch (Exception Ex)
            {
                oCommonEngine.SetAlert(this.Page, Ex.Message, Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Short);
                return(_RetVal);
            }
        }
示例#5
0
        private bool Validation()
        {
            bool _RetVal = false;

            try
            {
                if (txt_BusinessDay.Value.ToString().Trim().Replace("'", "") == "")
                {
                    //txtCode_Student.Value = oCommonEngine.GetAutoGenerateCode(strUserCode, strSiteCode, "Student");
                }
                if (txt_Status.Value.ToString().Trim().Replace("'", "") == "")
                {
                    oCommonEngine.SetAlert(this.Page, "Please enter Business Hours ...!", Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Short);
                    return(_RetVal);
                }


                _RetVal = true;
                return(_RetVal);
            }
            catch (Exception Ex)
            {
                oCommonEngine.SetAlert(this.Page, Ex.Message, Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Short);
                return(_RetVal);
            }
        }
        private bool Validation()
        {
            bool _RetVal = false;

            try
            {
                if (txtCode_VendorMaster.Value.ToString().Trim().Replace("'", "") == "")
                {
                    oCommonEngine.SetAlert(this.Page, "Please enter Supply Code...!", Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Short);
                    return(_RetVal);
                }

                if (txtSupplierName_VendorMaster.Value.ToString().Trim().Replace("'", "") == "")
                {
                    oCommonEngine.SetAlert(this.Page, "Please enter Supplier Name...!", Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Short);
                    return(_RetVal);
                }

                _RetVal = true;
                return(_RetVal);
            }
            catch (Exception Ex)
            {
                oCommonEngine.SetAlert(this.Page, Ex.Message, Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Short);
                return(_RetVal);
            }
        }
        private void LoadPageInformations(string _PKey1)
        {
            try
            {
                var client = new HttpClient();
                client.BaseAddress = new Uri(System.Configuration.ConfigurationManager.AppSettings["uri"]);
                client.DefaultRequestHeaders.Accept.Clear();
                client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
                string api      = "api/Stkprintlists?filter={\"where\":{\"docNo\":\"" + _PKey1 + "\"}}";
                var    response = client.GetAsync(api).Result;
                var    a        = response.Content.ReadAsStringAsync().Result;
                oDT_Header = (DataTable)JsonConvert.DeserializeObject(a, (typeof(DataTable)));
                oDT_Header.DefaultView.Sort = "docLineno asc";
                oDT_Header = oDT_Header.DefaultView.ToTable();
                ReportDataSource rds = new ReportDataSource("ds_Stkprintlist", oDT_Header);
                this.rv_webBI_GRNReturnPrint.LocalReport.DataSources.Clear();
                this.rv_webBI_GRNReturnPrint.LocalReport.DataSources.Add(rds);

                string strFromDate    = "";
                string strToDate      = "";
                string postData1Title = "{\"fromDate\":\"" + strFromDate.Trim() + "\"," +
                                        "\"toDate\":\"" + strToDate.Trim() + "\"," +
                                        //"\"ReportTitle\":\"" + "Sales Collection" + "\"," +
                                        "\"ReportTitle\":\"" + " Goods Return Print " + "\"," +
                                        "\"site\":\"" + System.Configuration.ConfigurationManager.AppSettings["SiteCode"].ToString() + "\"}";
                //oDT_GeneralTitle = oCommonEngine.GetDataTableFromAPI(Login.strAPIURL + "/api/webBI_ReportTittle", postData1Title);
                oDT_GeneralTitle = oCommonEngine.ExecuteDataTable("select '' as fromDate,'' as toDate ,'Goods Receive Note Print' as reportTitle,'' as site ,'' as userCode,'' as siteText, Comp_Title1 as companyHeader1,Comp_Title2 as companyHeader2,Comp_Title3 as companyHeader3,Comp_Title4 as companyHeader4,Footer_1 as companyFooter1,Footer_2 as companyFooter2,Footer_3 as companyFooter3,Footer_4 as companyFooter4 from Title where Product_License='" + oDT_Header.Rows[0]["storeNo"] + "'");
                ReportDataSource titledatasource = new ReportDataSource("ds_webBI_ReportTittle", oDT_GeneralTitle);
                this.rv_webBI_GRNReturnPrint.LocalReport.DataSources.Add(titledatasource);

                oDT_Logo = oCommonEngine.ExecuteDataTable("select Trans_Logo as Logo from Title  ");
                ReportDataSource Logodatasource = new ReportDataSource("ds_Logo", oDT_Logo);
                this.rv_webBI_GRNReturnPrint.LocalReport.DataSources.Add(Logodatasource);

                this.rv_webBI_GRNReturnPrint.LocalReport.ReportPath = "rpt_webGRNReturn.rdlc";
                this.rv_webBI_GRNReturnPrint.LocalReport.Refresh();
                this.rv_webBI_GRNReturnPrint.SizeToReportContent = true;
                this.rv_webBI_GRNReturnPrint.Width          = Unit.Percentage(100);
                this.rv_webBI_GRNReturnPrint.Height         = Unit.Percentage(100);
                this.rv_webBI_GRNReturnPrint.AsyncRendering = false;
                this.rv_webBI_GRNReturnPrint.ZoomMode       = ZoomMode.FullPage;
                oCommonEngine.SetAlert(this.Page, "Report Loaded Sucessfully...!", Utilities.CommonEngine.MessageType.Success, Utilities.CommonEngine.MessageDuration.Short);
            }
            catch (Exception Ex)
            {
                oCommonEngine.SetAlert(this.Page, Ex.Message, Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Medium);
                throw;
            }
        }
示例#8
0
        private bool Validation()
        {
            bool _RetVal = false;

            try
            {
                _RetVal = true;
                return(_RetVal);
            }
            catch (Exception Ex)
            {
                oCommonEngine.SetAlert(this.Page, Ex.Message, CommonEngine.MessageType.Error, CommonEngine.MessageDuration.Short);
                return(_RetVal);
            }
        }
示例#9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["AlertMessage"] != null)
     {
         oCommonEngine.SetAlert(this.Page, Session["AlertMessage"].ToString(), Utilities.CommonEngine.MessageType.Success, Utilities.CommonEngine.MessageDuration.Short);
         Session["AlertMessage"] = null;
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                GetControlNo();

                if (!IsPostBack)
                {
                    if (Request.QueryString["PKey"] != null)
                    {
                        _PKey      = Request.QueryString["PKey"].ToString();
                        _ClassCode = Request.QueryString["Code"].ToString();
                        txtCode_CorporateCustomer.Value    = _ClassCode;
                        txtCode_CorporateCustomer.Disabled = true;
                        FetchRecords();
                        btnCorporateOperation.InnerText = "Update";
                    }
                    else
                    {
                        _PKey = "";
                        btnCorporateOperation.InnerText = "Add";
                    }
                }

                if (Request.QueryString["PKey"] != null)
                {
                    _PKey = Request.QueryString["PKey"].ToString();
                }
            }
            catch (Exception Ex)
            {
                oCommonEngine.SetAlert(this.Page, Ex.Message, Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Medium);
            }
        }
示例#11
0
 protected void GlobalSearch_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtGlobalSearch_Home.Value.Trim() != "")
         {
             Response.Redirect("~/SearchInfo.aspx?PKey=" + txtGlobalSearch_Home.Value.Trim() + "");
         }
     }
     catch (Exception Ex)
     {
         oCommonEngine.SetAlert(this.Page, Ex.Message, Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Short);
     }
 }
示例#12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Session["AlertMessage"] != null)
                {
                    oCommonEngine.SetAlert(this.Page, Session["AlertMessage"].ToString(), Utilities.CommonEngine.MessageType.Success, Utilities.CommonEngine.MessageDuration.Short);
                    Session["AlertMessage"] = null;
                }

                Get_ControlNo_Prefixs();
                Get_AgeGroup();
                Get_Race();
                Get_SkinType();
                Get_CorporateCustomer();
                Get_Sources();
                Get_OccupationTypes();

                if (Request.QueryString["PKey"] != null)
                {
                    CollapsiblePanelCorporateCustomer.Collapsed = false;
                    CollapsiblePanelRace.Collapsed              = false;
                    CollapsiblePanelAgeGroup.Collapsed          = false;
                    CollapsiblePanelCorporateCustomer.Collapsed = false;
                    CollapsiblePanelSkinType.Collapsed          = false;
                    CollapsiblePanelLanguage.Collapsed          = false;
                }

                Get_Language();
                Get_Locations();
                Get_Gender();
            }
            catch (Exception Ex)
            {
                oCommonEngine.SetAlert(this.Page, Ex.Message, Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Medium);
            }
        }
        private bool Validation()
        {
            bool _RetVal = false;

            try
            {
                if (txt_PayCode.Value.ToString().Trim().Replace("'", "") == "")
                {
                    oCommonEngine.SetAlert(this.Page, "Please enter Pay Code...!", Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Short);
                    return(_RetVal);
                }
                if (txt_PayDesc.Value.ToString().Trim().Replace("'", "") == "")
                {
                    oCommonEngine.SetAlert(this.Page, "Please enter Pay Description...!", Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Short);
                    return(_RetVal);
                }
                if (ddlPayGroup.Value.ToString().Trim().Replace("'", "") == "")
                {
                    oCommonEngine.SetAlert(this.Page, "Please enter Site Description...!", Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Short);
                    return(_RetVal);
                }
                //if (txtPostCode_Site.Value.ToString().Trim().Replace("'", "") == "")
                //{
                //    oCommonEngine.SetAlert(this.Page, "Please enter PostCode...!", Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Short);
                //    return _RetVal;
                //}

                _RetVal = true;
                return(_RetVal);
            }
            catch (Exception Ex)
            {
                oCommonEngine.SetAlert(this.Page, Ex.Message, Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Short);
                return(_RetVal);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                Get_ControlPrefixs();
                if (!IsPostBack)
                {
                }
                ;

                Get_AppointmentChannel();
            }
            catch (Exception Ex)
            {
                oCommonEngine.SetAlert(this.Page, Ex.Message, Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Medium);
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!IsPostBack)
         {
         }
         ;
         Get_Cities();
         Get_States();
         Get_Countries();
     }
     catch (Exception Ex)
     {
         oCommonEngine.SetAlert(this.Page, Ex.Message, Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Medium);
     }
 }
        private bool Validation()
        {
            bool _RetVal = false;

            try
            {
                if (txtDesc_ApptBookingStatus.Value.ToString().Trim().Replace("'", "") == "")
                {
                    oCommonEngine.SetAlert(this.Page, "Please enter Description...!", Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Short);
                    return(_RetVal);
                }

                _RetVal = true;
                return(_RetVal);
            }
            catch (Exception Ex)
            {
                oCommonEngine.SetAlert(this.Page, Ex.Message, Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Short);
                return(_RetVal);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                Get_ControlPrefixs();
                Get_CustomerClass();
                Get_CustomerTypes();
                Get_CustomerGroup1s();
                Get_CustomerGroup2s();
                Get_CustomerGroup3s();
                Get_ProductGroups();

                if (Request.QueryString["PKey"] != null)
                {
                    CollapsiblePanelCustomerClass.Collapsed = false;
                }
            }
            catch (Exception Ex)
            {
                oCommonEngine.SetAlert(this.Page, Ex.Message, Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Medium);
            }
        }
示例#18
0
        protected void LoadDepartments()
        {
            try
            {
                //HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create(string.Format("http://103.253.14.203:3000/api/ItemDepts"));
                HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create(string.Format(System.Configuration.ConfigurationManager.AppSettings["uri"] + "api/ItemDepts"));
                WebReq.Method = "GET";

                HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();

                Console.WriteLine(WebResp.StatusCode);
                Console.WriteLine(WebResp.Server);

                string jsonString;
                using (Stream stream = WebResp.GetResponseStream())   //modified from your code since the using statement disposes the stream automatically when done
                {
                    StreamReader reader = new StreamReader(stream, System.Text.Encoding.UTF8);
                    jsonString = reader.ReadToEnd();
                }

                // DataTable dt = JsonConvert.DeserializeAnonymousType(jsonString, new { result = default(DataTable) }).result;
                ;

                oDT_Depts = (DataTable)JsonConvert.DeserializeObject(jsonString, (typeof(DataTable)));

                if (oDT_Depts.Rows.Count > 0)
                {
                    for (int i = 0; i < oDT_Depts.Rows.Count; i++)
                    {
                        HtmlTableRow  _Row = new HtmlTableRow();
                        HtmlTableCell Col  = new HtmlTableCell();
                        Col.InnerText = oDT_Depts.Rows[i]["itmCode"].ToString();
                        _Row.Controls.Add(Col);

                        Col           = new HtmlTableCell();
                        Col.InnerText = oDT_Depts.Rows[i]["itmDesc"].ToString();
                        _Row.Controls.Add(Col);

                        Col = new HtmlTableCell();
                        _Row.Controls.Add(Col);
                        _Row.Controls.Add(Col);
                        var _ctrl = new HtmlInputText("Integer");
                        Col.Controls.Add(_ctrl);
                        //Col.InnerHtml = "<input type='text' value='0'>";
                        //Col.Attributes.Add("id", "dis" + i);
                        _Row.Controls.Add(Col);

                        Col           = new HtmlTableCell();
                        Col.InnerText = oDT_Depts.Rows[i]["itmId"].ToString();
                        Col.Attributes.Add("style", "width: 0px; display:none");
                        _Row.Controls.Add(Col);

                        //dor discount id
                        Col           = new HtmlTableCell();
                        Col.InnerText = "";
                        Col.Attributes.Add("style", "width: 0px; display:none");
                        _Row.Controls.Add(Col);

                        tblDiscount.Rows.Add(_Row);

                        var cell       = tblDiscount.Rows[i + 1].Cells[2];
                        var txtDynamic = cell.Controls.OfType <HtmlInputText>().FirstOrDefault();
                        txtDynamic.Value = "0";
                    }
                }
            }

            catch (Exception Ex)
            {
                oCommonEngine.SetAlert(this.Page, Ex.Message, Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Medium);
            }
        }
示例#19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Session["AlertMessage"] != null)
                {
                    oCommonEngine.SetAlert(this.Page, Session["AlertMessage"].ToString(), Utilities.CommonEngine.MessageType.Success, Utilities.CommonEngine.MessageDuration.Short);
                    Session["AlertMessage"] = null;
                }
                //if (Session["User_UserCode"] == null)
                //{
                //    strUserCode = "";
                //    strSiteCode = "";
                //    Response.Redirect("~/Login.aspx");
                //}
                //else
                //{
                //    strUserCode = (string)Session["User_UserCode"];
                //    strSiteCode = (string)Session["User_SiteCode"];
                //}
                if (!IsPostBack)
                {
                    LoadValue();
                    LoadPageInformations();
                }

                if (Request.QueryString["PKey"] != null)
                {
                    _PKey = Request.QueryString["PKey"].ToString();
                    btnSubmit_AddGRN.InnerText = "Edit";

                    using (var client = new HttpClient())
                    {
                        client.BaseAddress = new Uri(System.Configuration.ConfigurationManager.AppSettings["uri"]);
                        client.DefaultRequestHeaders.Accept.Clear();
                        client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
                        //GET Method
                        string api      = "api/StkMovdocHdrs?filter={\"where\":{\"docNo\":\"" + _PKey + "\"}}";
                        var    response = client.GetAsync(api).Result;
                        if (response.IsSuccessStatusCode)
                        {
                            var a = response.Content.ReadAsStringAsync().Result;
                            List <StkMovdocHdrsInput> StkMovdocHdrsVal = JsonConvert.DeserializeObject <List <StkMovdocHdrsInput> >(a);
                            txtDocNo_GRN.Value = StkMovdocHdrsVal[0].docNo;

                            dt_DocDateGRN.Value = Convert.ToDateTime(StkMovdocHdrsVal[0].docDate).ToString("dd/MM/yyyy");
                            if (StkMovdocHdrsVal[0].recStatus == "0")
                            {
                                txtStatus_GRN.Value = "Open";
                            }
                            else
                            {
                                txtStatus_GRN.Value = "Posted";
                            }

                            ddl_supplierGRN.Value       = StkMovdocHdrsVal[0].supplyNo;
                            dt_DeliveryDateGRN.Value    = Convert.ToDateTime(StkMovdocHdrsVal[0].docDate).ToString("dd/MM/yyyy");
                            txtTerm_GRN.Value           = StkMovdocHdrsVal[0].docTerm;
                            txtPO1Ref_GRN.Value         = StkMovdocHdrsVal[0].docRef1;
                            ddlStoreCode_GRN.Value      = StkMovdocHdrsVal[0].storeNo;
                            txtGrn1Ref_GRN.Value        = StkMovdocHdrsVal[0].docRef2;
                            ddlCreatedBy_GRN.Value      = StkMovdocHdrsVal[0].staffNo;
                            txtRemark_GRN.Value         = StkMovdocHdrsVal[0].docRemk1;
                            txt_TotAmntGRN.Value        = StkMovdocHdrsVal[0].docAmt;
                            txtAttnTo_GRN.Value         = StkMovdocHdrsVal[0].docAttn;
                            txtAddress1_GRN.Value       = StkMovdocHdrsVal[0].baddr1;
                            txtShipToAddress1_GRN.Value = StkMovdocHdrsVal[0].daddr1;
                            txtAddress2_GRN.Value       = StkMovdocHdrsVal[0].baddr2;
                            txtShipToAddress2_GRN.Value = StkMovdocHdrsVal[0].daddr2;
                            txtAddress3_GRN.Value       = StkMovdocHdrsVal[0].baddr3;
                            txtShipToAddress3_GRN.Value = StkMovdocHdrsVal[0].daddr3;
                            txtPostCode_GRN.Value       = StkMovdocHdrsVal[0].bpostcode;
                            txtPostCodeTo_GRN.Value     = StkMovdocHdrsVal[0].dpostcode;
                            txtCity_GRN.Value           = StkMovdocHdrsVal[0].bcity;
                            txtCityTo_GRN.Value         = StkMovdocHdrsVal[0].dcity;
                            txtState_GRN.Value          = StkMovdocHdrsVal[0].bstate;
                            txtStateTo_GRN.Value        = StkMovdocHdrsVal[0].dstate;
                            txtCountry_GRN.Value        = StkMovdocHdrsVal[0].bcountry;
                            txtCountryTo_GRN.Value      = StkMovdocHdrsVal[0].dcountry;
                            txtRemark1_GRN.Value        = StkMovdocHdrsVal[0].docRemk2;
                            txtRemark2_GRN.Value        = StkMovdocHdrsVal[0].docRemk3;
                            recStatus = StkMovdocHdrsVal[0].recStatus;
                            if (StkMovdocHdrsVal[0].recStatus == "0")
                            {
                                btnSubmit_AddGRN.Disabled  = false;
                                btnSubmit_PostGRN.Disabled = false;
                            }
                            else
                            {
                                btnSubmit_AddGRN.Disabled  = true;
                                btnSubmit_PostGRN.Disabled = true;
                            }
                        }
                        else
                        {
                            Console.WriteLine("Internal server Error");
                        }
                    }

                    List <StkMovdocDtls> StkMovdocDtlsVal = JsonConvert.DeserializeObject <List <StkMovdocDtls> >(GetapiCalling("api/StkMovdocDtls?filter={\"where\":{\"docNo\":\"" + _PKey + "\"}}"));
                    if (StkMovdocDtlsVal.Count > 0 && GRNEntryModule.Rows.Count == 1)
                    {
                        for (int i = 0; i < StkMovdocDtlsVal.Count; i++)
                        {
                            HtmlTableRow _Row = new HtmlTableRow();

                            HtmlTableCell Col_0 = new HtmlTableCell();
                            Col_0.Attributes.Add("style", "width: 0 % ;visibility:hidden;");
                            Col_0.InnerHtml = StkMovdocDtlsVal[i].docId;
                            //Col_15.InnerHtml = "<input type='hidden' class=form-control' value=" + StkMovdocDtlsVal[i].docId + " id='txthiddenId_GRNDtl' runat='server'>";
                            _Row.Controls.Add(Col_0);


                            HtmlTableCell Col_1 = new HtmlTableCell();
                            Col_1.Attributes.Add("style", "width: 0 % ;visibility:hidden;");
                            Col_1.InnerHtml = StkMovdocDtlsVal[i].docUom;
                            _Row.Controls.Add(Col_1);

                            HtmlTableCell Col_2 = new HtmlTableCell();
                            Col_2.Attributes.Add("style", "width: 5 %");
                            Col_2.InnerText = StkMovdocDtlsVal[i].docLineno;
                            _Row.Controls.Add(Col_2);

                            HtmlTableCell Col_3 = new HtmlTableCell();
                            Col_3.Attributes.Add("style", "width: 10 %");
                            Col_3.InnerText = StkMovdocDtlsVal[i].itemcode;
                            _Row.Controls.Add(Col_3);

                            HtmlTableCell Col_4 = new HtmlTableCell();
                            Col_4.Attributes.Add("style", "width: 20 %");
                            Col_4.InnerText = StkMovdocDtlsVal[i].itemdesc;
                            _Row.Controls.Add(Col_4);

                            HtmlTableCell Col_5 = new HtmlTableCell();
                            Col_5.Attributes.Add("style", "width: 10 %");
                            Col_5.InnerText = StkMovdocDtlsVal[i].itmBrandDesc;
                            _Row.Controls.Add(Col_5);

                            HtmlTableCell Col_6 = new HtmlTableCell();
                            Col_6.Attributes.Add("style", "width: 10 %");
                            Col_6.InnerText = StkMovdocDtlsVal[i].itmRangeDesc;
                            _Row.Controls.Add(Col_6);

                            HtmlTableCell Col_7 = new HtmlTableCell();
                            Col_7.Attributes.Add("style", "width: 10 %");
                            Col_7.InnerText = StkMovdocDtlsVal[i].docPrice;
                            _Row.Controls.Add(Col_7);

                            HtmlTableCell Col_8 = new HtmlTableCell();
                            Col_8.Attributes.Add("style", "width: 10 %");
                            Col_8.InnerText = StkMovdocDtlsVal[i].DOCUOMDesc;
                            _Row.Controls.Add(Col_8);

                            HtmlTableCell Col_9 = new HtmlTableCell();
                            Col_9.Attributes.Add("style", "width: 10 %");
                            Col_9.InnerText = StkMovdocDtlsVal[i].docQty;
                            _Row.Controls.Add(Col_9);

                            HtmlTableCell Col_10 = new HtmlTableCell();
                            Col_10.Attributes.Add("style", "width: 10 %");
                            Col_10.InnerText = StkMovdocDtlsVal[i].docAmt;
                            _Row.Controls.Add(Col_10);

                            HtmlTableCell Col_15 = new HtmlTableCell();
                            Col_15.Attributes.Add("style", "width: 10 %");
                            Col_15.InnerText = StkMovdocDtlsVal[i].itemRemark;
                            _Row.Controls.Add(Col_15);


                            HtmlTableCell Col_11 = new HtmlTableCell();
                            Col_11.Attributes.Add("style", "width: 10%; text-align:center");
                            Col_11.InnerHtml = "<div class='tools'><i class='edit_AddItemToGRN glyphicon glyphicon-pencil'></i></div>";
                            _Row.Controls.Add(Col_11);

                            if (recStatus == "0")
                            {
                                HtmlTableCell Col_12 = new HtmlTableCell();
                                Col_12.Attributes.Add("style", "width: 10%; text-align:center");
                                Col_12.InnerHtml = "<div class='tools'><i class='Remove_AddItemToGRNAfterSave glyphicon glyphicon-trash'></i></div>";
                                _Row.Controls.Add(Col_12);
                            }



                            HtmlTableCell Col_13 = new HtmlTableCell();
                            Col_13.Attributes.Add("style", "width: 0 % ;visibility:hidden;");
                            Col_13.InnerHtml = StkMovdocDtlsVal[i].itmBrand;
                            _Row.Controls.Add(Col_13);

                            HtmlTableCell Col_14 = new HtmlTableCell();
                            Col_14.Attributes.Add("style", "width: 0 % ;visibility:hidden;");
                            Col_14.InnerHtml = StkMovdocDtlsVal[i].itmRange;
                            _Row.Controls.Add(Col_14);

                            GRNEntryModule.Rows.Add(_Row);
                        }
                    }
                }
                else
                {
                    btnSubmit_AddGRN.InnerText = "Add";
                    txtStatus_GRN.Value        = "Open";
                    _PKey = "";
                    //FetchRecordAsync();
                    dt_DocDateGRN.Value      = DateTime.Now.ToString("dd/MM/yyyy");
                    dt_DeliveryDateGRN.Value = DateTime.Now.ToString("dd/MM/yyyy");
                }
            }
            catch (Exception Ex)
            {
                oCommonEngine.SetAlert(this.Page, Ex.Message, Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Medium);
            }
        }
示例#20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Session["AlertMessage"] != null)
                {
                    oCommonEngine.SetAlert(this.Page, Session["AlertMessage"].ToString(), Utilities.CommonEngine.MessageType.Success, Utilities.CommonEngine.MessageDuration.Short);
                    Session["AlertMessage"] = null;
                }
                //if (Session["User_UserCode"] == null)
                //{
                //    strUserCode = "";
                //    strSiteCode = "";
                //    Response.Redirect("~/Login.aspx");
                //}
                //else
                //{
                //    strUserCode = (string)Session["User_UserCode"];
                //    strSiteCode = (string)Session["User_SiteCode"];
                //}
                if (!IsPostBack)
                {
                    LoadValue();
                    LoadPageInformations();
                }

                if (Request.QueryString["PKey"] != null)
                {
                    _PKey = Request.QueryString["PKey"].ToString();
                    btnSubmit_AddPo.InnerText = "Edit";

                    using (var client = new HttpClient())
                    {
                        client.BaseAddress = new Uri(System.Configuration.ConfigurationManager.AppSettings["uri"]);
                        client.DefaultRequestHeaders.Accept.Clear();
                        client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
                        //GET Method
                        string api      = "api/pos?filter={\"where\":{\"poNo\":\"" + _PKey + "\"}}";
                        var    response = client.GetAsync(api).Result;
                        if (response.IsSuccessStatusCode)
                        {
                            var             a = response.Content.ReadAsStringAsync().Result;
                            List <posInput> StkMovdocHdrsVal = JsonConvert.DeserializeObject <List <posInput> >(a);
                            txtDocNo_Po.Value = StkMovdocHdrsVal[0].poNo;

                            dt_DocDatePo.Value = Convert.ToDateTime(StkMovdocHdrsVal[0].poDate).ToString("dd/MM/yyyy");
                            txtStatus_Po.Value = StkMovdocHdrsVal[0].poStatus;
                            //if (StkMovdocHdrsVal[0].poStatus == "0")
                            //{
                            //    txtStatus_Po.Value = "Open";
                            //}
                            //else
                            //{
                            //    txtStatus_Po.Value = "Posted";
                            //}
                            ddl_supplierPo.Value  = StkMovdocHdrsVal[0].suppCode;
                            ddlStoreCode_Po.Value = StkMovdocHdrsVal[0].itemsiteCode;
                            txtRemark_Po.Value    = StkMovdocHdrsVal[0].poRemk1;
                            txt_TotAmntPo.Value   = StkMovdocHdrsVal[0].poTtqty;
                            txtTotQty_Po.Value    = StkMovdocHdrsVal[0].poTtqty;
                            recStatus             = StkMovdocHdrsVal[0].poStatus;
                            if (StkMovdocHdrsVal[0].poStatus == "Open")
                            {
                                btnSubmit_AddPo.Disabled  = false;
                                btnSubmit_PostPo.Disabled = false;
                            }
                            else
                            {
                                btnSubmit_AddPo.Disabled  = true;
                                btnSubmit_PostPo.Disabled = true;
                            }
                        }
                        else
                        {
                            Console.WriteLine("Internal server Error");
                        }
                    }

                    List <poDtls> StkMovdocDtlsVal = JsonConvert.DeserializeObject <List <poDtls> >(GetapiCalling("api/podetails?filter={\"where\":{\"poNo\":\"" + _PKey + "\"}}"));
                    if (StkMovdocDtlsVal.Count > 0 && PoEntryModule.Rows.Count == 1)
                    {
                        for (int i = 0; i < StkMovdocDtlsVal.Count; i++)
                        {
                            HtmlTableRow _Row = new HtmlTableRow();

                            HtmlTableCell Col_0 = new HtmlTableCell();
                            Col_0.Attributes.Add("style", "width: 0 % ;visibility:hidden;");
                            Col_0.InnerHtml = StkMovdocDtlsVal[i].poId;
                            //Col_15.InnerHtml = "<input type='hidden' class=form-control' value=" + StkMovdocDtlsVal[i].docId + " id='txthiddenId_PoDtl' runat='server'>";
                            _Row.Controls.Add(Col_0);


                            HtmlTableCell Col_2 = new HtmlTableCell();
                            Col_2.Attributes.Add("style", "width: 5 %");
                            Col_2.InnerText = StkMovdocDtlsVal[i].linenumber;
                            _Row.Controls.Add(Col_2);

                            HtmlTableCell Col_3 = new HtmlTableCell();
                            Col_3.Attributes.Add("style", "width: 10 %");
                            Col_3.InnerText = StkMovdocDtlsVal[i].podItemcode;
                            _Row.Controls.Add(Col_3);

                            HtmlTableCell Col_4 = new HtmlTableCell();
                            Col_4.Attributes.Add("style", "width: 20 %");
                            Col_4.InnerText = StkMovdocDtlsVal[i].podItemdesc;
                            _Row.Controls.Add(Col_4);

                            HtmlTableCell Col_5 = new HtmlTableCell();
                            Col_5.Attributes.Add("style", "width: 10 %");
                            Col_5.InnerText = StkMovdocDtlsVal[i].brandname;
                            _Row.Controls.Add(Col_5);

                            HtmlTableCell Col_6 = new HtmlTableCell();
                            Col_6.Attributes.Add("style", "width: 10 %");
                            Col_6.InnerText = StkMovdocDtlsVal[i].podItemprice;
                            _Row.Controls.Add(Col_6);

                            HtmlTableCell Col_7 = new HtmlTableCell();
                            Col_7.Attributes.Add("style", "width: 10 %");
                            Col_7.InnerText = StkMovdocDtlsVal[i].podDiscper;
                            _Row.Controls.Add(Col_7);

                            HtmlTableCell Col_8 = new HtmlTableCell();
                            Col_8.Attributes.Add("style", "width: 10 %");
                            Col_8.InnerText = StkMovdocDtlsVal[i].podDiscamt;
                            _Row.Controls.Add(Col_8);

                            HtmlTableCell Col_9 = new HtmlTableCell();
                            Col_9.Attributes.Add("style", "width: 10 %");
                            Col_9.InnerText = StkMovdocDtlsVal[i].podQty;
                            _Row.Controls.Add(Col_9);

                            if (recStatus == "Open")
                            {
                                HtmlTableCell Col_12 = new HtmlTableCell();
                                Col_12.Attributes.Add("style", "width: 10%; text-align:center");
                                Col_12.InnerHtml = "<div class='tools'><i class='Remove_AddItemToPoAfterSave glyphicon glyphicon-trash'></i></div>";
                                _Row.Controls.Add(Col_12);
                            }
                            PoEntryModule.Rows.Add(_Row);
                        }
                    }
                }
                else
                {
                    btnSubmit_AddPo.InnerText = "Add";
                    txtStatus_Po.Value        = "Open";
                    _PKey = "";
                    //FetchRecordAsync();
                    dt_DocDatePo.Value = DateTime.Now.ToString("dd/MM/yyyy");
                    //using (var client = new HttpClient())
                    //{
                    //    client.BaseAddress = new Uri(System.Configuration.ConfigurationManager.AppSettings["uri"]);
                    //    client.DefaultRequestHeaders.Accept.Clear();
                    //    client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
                    //    //GET Method
                    //    string codeDesc = "PO REQUISITE";
                    //    string api = "api/ControlNos?filter={\"where\":{\"controlDescription\":\"" + codeDesc + "\"}}";
                    //    var response = client.GetAsync(api).Result;
                    //    if (response.IsSuccessStatusCode)
                    //    {
                    //        var a = response.Content.ReadAsStringAsync().Result;
                    //        List<ControlNos> PoReq = JsonConvert.DeserializeObject<List<ControlNos>>(a);
                    //        txtDocNo_Po.Value = PoReq[0].controlPrefix + PoReq[0].siteCode + PoReq[0].controlNo;
                    //    }
                    //    else
                    //    {
                    //        Console.WriteLine("Internal server Error");
                    //    }
                    //}
                }
            }
            catch (Exception Ex)
            {
                oCommonEngine.SetAlert(this.Page, Ex.Message, Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Medium);
            }
        }
示例#21
0
        private void LoadPageInformations()
        {
            try
            {
                string strDept         = "";
                string strBrand        = "";
                string strRange        = "";
                string strSite         = "";
                string strFromItem     = "";
                string strToItem       = "";
                string strAsOnDate     = "";
                string strShowZeroQty  = "N";
                string strShowInactive = "N";
                for (int i = 0; i < ddlDept_webBI_StockBalance.Items.Count; i++)
                {
                    if (ddlDept_webBI_StockBalance.Items[i].Selected == true)
                    {
                        strDept = strDept + ddlDept_webBI_StockBalance.Items[i].Value.ToString().Trim().Replace("'", "") + ",";
                    }
                }
                for (int i = 0; i < ddlBrand_webBI_StockBalance.Items.Count; i++)
                {
                    if (ddlBrand_webBI_StockBalance.Items[i].Selected == true)
                    {
                        strBrand = strBrand + ddlBrand_webBI_StockBalance.Items[i].Value.ToString().Trim().Replace("'", "") + ",";
                    }
                }
                for (int i = 0; i < ddlRange_webBI_StockBalance.Items.Count; i++)
                {
                    if (ddlRange_webBI_StockBalance.Items[i].Selected == true)
                    {
                        strRange = strRange + ddlRange_webBI_StockBalance.Items[i].Value.ToString().Trim().Replace("'", "") + ",";
                    }
                }
                for (int i = 0; i < ddlSite_webBI_StockBalance.Items.Count; i++)
                {
                    if (ddlSite_webBI_StockBalance.Items[i].Selected == true)
                    {
                        strSite = strSite + ddlSite_webBI_StockBalance.Items[i].Value.ToString().Trim().Replace("'", "") + ",";
                    }
                }
                for (int i = 0; i < ddlFItem_webBI_StockBalance.Items.Count; i++)
                {
                    if (ddlFItem_webBI_StockBalance.Items[i].Selected == true)
                    {
                        strFromItem = strFromItem + ddlFItem_webBI_StockBalance.Items[i].Value.ToString().Trim().Replace("'", "") + ",";
                    }
                }

                //strFromItem = ddlFItem_webBI_StockBalance.Items[ddlFItem_webBI_StockBalance.SelectedIndex].Value;
                //strToItem = ddlTItem_webBI_StockBalance.Items[ddlTItem_webBI_StockBalance.SelectedIndex].Value;
                strAsOnDate = dtAsOnDate_webBI_StockBalance.Value.ToString();
                if (chkShowZeroQtyItems_webBI_StockBalance.Checked)
                {
                    strShowZeroQty = "Y";
                }
                if (chkShowInActive_webBI_StockBalance.Checked)
                {
                    strShowInactive = "Y";
                }
                string postData = "{\"toDate\":\"" + strAsOnDate.Trim() + "\"," +
                                  "\"Site\":\"" + strSite.Trim() + "\"," +
                                  "\"Dept\":\"" + strDept.Trim() + "\"," +
                                  "\"Brand\":\"" + strBrand.Trim() + "\"," +
                                  "\"fromItem\":\"" + strFromItem.Trim() + "\"," +
                                  "\"toItem\":\"" + strToItem.Trim() + "\"," +
                                  "\"Range\":\"" + strRange.Trim() + "\"," +
                                  "\"showInActive\":\"" + strShowInactive.Trim() + "\"," +
                                  "\"showZeroQty\":\"" + strShowZeroQty.Trim() + "\"}";
                oDT_General = oCommonEngine.GetDataTableFromAPI(Login.strAPIURL + "/api/webInventory_StockBalance", postData);
                ReportDataSource rds = new ReportDataSource("ds_webBI_StockBalance", oDT_General);
                this.rv_webBI_StockBalance.LocalReport.DataSources.Clear();
                this.rv_webBI_StockBalance.LocalReport.DataSources.Add(rds);

                string postData1Title = "{\"fromDate\":\"" + strAsOnDate.Trim() + "\"," +
                                        "\"toDate\":\"" + strSite.Trim() + "\"," +
                                        "\"ReportTitle\":\"" + "Stock Balance" + "\"," +
                                        "\"site\":\"" + strSite.Trim() + "\"}";
                //oDT_GeneralTitle = oCommonEngine.GetDataTableFromAPI(Login.strAPIURL + "/api/webBI_ReportTittle", postData1Title);
                oDT_GeneralTitle = oCommonEngine.ExecuteDataTable("select '' as fromDate,'' as toDate ,'Goods Receive Note Print' as reportTitle,'' as site ,'' as userCode,'' as siteText, Comp_Title1 as companyHeader1,Comp_Title2 as companyHeader2,Comp_Title3 as companyHeader3,Comp_Title4 as companyHeader4,Footer_1 as companyFooter1,Footer_2 as companyFooter2,Footer_3 as companyFooter3,Footer_4 as companyFooter4 from Title where Product_License='" + ddlSite_webBI_StockBalance.Value + "'");
                ReportDataSource titledatasource = new ReportDataSource("ds_webBI_ReportTittle", oDT_GeneralTitle);
                this.rv_webBI_StockBalance.LocalReport.DataSources.Add(titledatasource);

                this.rv_webBI_StockBalance.LocalReport.ReportPath = "rpt_webBI_StockBalance.rdlc";
                this.rv_webBI_StockBalance.LocalReport.Refresh();
                this.rv_webBI_StockBalance.SizeToReportContent = true;
                this.rv_webBI_StockBalance.Width          = Unit.Percentage(100);
                this.rv_webBI_StockBalance.Height         = Unit.Percentage(100);
                this.rv_webBI_StockBalance.AsyncRendering = false;
                this.rv_webBI_StockBalance.ZoomMode       = ZoomMode.FullPage;
                oCommonEngine.SetAlert(this.Page, "Report Loaded Sucessfully...!", Utilities.CommonEngine.MessageType.Success, Utilities.CommonEngine.MessageDuration.Short);
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Session["AlertMessage"] != null)
                {
                    oCommonEngine.SetAlert(this.Page, Session["AlertMessage"].ToString(), Utilities.CommonEngine.MessageType.Success, Utilities.CommonEngine.MessageDuration.Short);
                    Session["AlertMessage"] = null;
                }
                //if (Session["User_UserCode"] == null)
                //{
                //    strUserCode = "";
                //    strSiteCode = "";
                //    Response.Redirect("~/Login.aspx");
                //}
                //else
                //{
                //    strUserCode = (string)Session["User_UserCode"];
                //    strSiteCode = (string)Session["User_SiteCode"];
                //}
                if (Request.QueryString["PKey"] != null)
                {
                    _PKey = Request.QueryString["PKey"].ToString();
                    //btnSubmit_AddDivMaster.InnerText = "Edit";
                    btnSubmit_AddDivMaster.InnerText = "Update";

                    using (var client = new HttpClient())
                    {
                        client.BaseAddress = new Uri(System.Configuration.ConfigurationManager.AppSettings["uri"]);
                        client.DefaultRequestHeaders.Accept.Clear();
                        client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
                        //GET Method
                        string api      = "api/itemdivs?filter={\"where\":{\"itmCode\":\"" + _PKey + "\"}}";
                        var    response = client.GetAsync(api).Result;
                        if (response.IsSuccessStatusCode)
                        {
                            var a = response.Content.ReadAsStringAsync().Result;
                            List <itemDivInput> depts = JsonConvert.DeserializeObject <List <itemDivInput> >(a);
                            txtCode_DivMaster.Value = depts[0].itmCode;
                            txtName_DivMaster.Value = depts[0].itmDesc;
                            if (depts[0].itmIsactive == true)
                            {
                                chk_ActiveDivMaster.Checked = true;
                            }
                            else
                            {
                                chk_ActiveDivMaster.Checked = false;
                            }
                        }
                        else
                        {
                            Console.WriteLine("Internal server Error");
                        }
                    }
                }
                else
                {
                    btnSubmit_AddDivMaster.InnerText = "Add";
                    _PKey = "";
                    txtCode_DivMaster.Focus();
                    //FetchRecordAsync();

                    //using (var client = new HttpClient())
                    //{
                    //    client.BaseAddress = new Uri(System.Configuration.ConfigurationManager.AppSettings["uri"]);
                    //    client.DefaultRequestHeaders.Accept.Clear();
                    //    client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
                    //    //GET Method
                    //    string codeDesc = "DIV CODE";
                    //    string api = "api/ControlNos?filter={\"where\":{\"controlDescription\":\"" + codeDesc + "\"}}";
                    //    var response = client.GetAsync(api).Result;
                    //    if (response.IsSuccessStatusCode)
                    //    {
                    //        var a = response.Content.ReadAsStringAsync().Result;
                    //        List<ControlNos> depts = JsonConvert.DeserializeObject<List<ControlNos>>(a);
                    //        txtCode_DivMaster.Value = depts[0].controlNo;
                    //    }
                    //    else
                    //    {
                    //        Console.WriteLine("Internal server Error");
                    //    }
                    //}
                }
                if (!IsPostBack)
                {
                    LoadValue();
                    LoadPageInformations();
                }
            }
            catch (Exception Ex)
            {
                oCommonEngine.SetAlert(this.Page, Ex.Message, Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Medium);
            }
        }
示例#23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (Session["AlertMessage"] != null)
                {
                    oCommonEngine.SetAlert(this.Page, Session["AlertMessage"].ToString(), Utilities.CommonEngine.MessageType.Success, Utilities.CommonEngine.MessageDuration.Short);
                    Session["AlertMessage"] = null;
                }
                //if (Session["User_UserCode"] == null)
                //{
                //    strUserCode = "";
                //    strSiteCode = "";
                //    Response.Redirect("~/Login.aspx");
                //}
                //else
                //{
                //    strUserCode = (string)Session["User_UserCode"];
                //    strSiteCode = (string)Session["User_SiteCode"];
                //}
                if (!IsPostBack)
                {
                    LoadValue();
                    LoadPageInformations();
                }

                if (Request.QueryString["PKey"] != null)
                {
                    _PKey = Request.QueryString["PKey"].ToString();

                    using (var client = new HttpClient())
                    {
                        client.BaseAddress = new Uri(System.Configuration.ConfigurationManager.AppSettings["uri"]);
                        client.DefaultRequestHeaders.Accept.Clear();
                        client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
                        //GET Method
                        string api      = "api/pos?filter={\"where\":{\"poNo\":\"" + _PKey + "\"}}";
                        var    response = client.GetAsync(api).Result;
                        if (response.IsSuccessStatusCode)
                        {
                            var             a = response.Content.ReadAsStringAsync().Result;
                            List <posInput> StkMovdocHdrsVal = JsonConvert.DeserializeObject <List <posInput> >(a);
                            txtDocNo_PoApprovedView.Value = StkMovdocHdrsVal[0].poNo;

                            dt_DocDate_PoApprovedView.Value = Convert.ToDateTime(StkMovdocHdrsVal[0].poDate).ToString("dd/MM/yyyy");
                            txtStatus_PoApprovedView.Value  = StkMovdocHdrsVal[0].poStatus;
                            //if (StkMovdocHdrsVal[0].poStatus == "0")
                            //{
                            //    txtStatus_Po.Value = "Open";
                            //}
                            //else
                            //{
                            //    txtStatus_Po.Value = "Posted";
                            //}
                            ddl_supplier_PoApprovedView.Value       = StkMovdocHdrsVal[0].suppCode;
                            ddlStoreCode_PoApprovedView.Value       = StkMovdocHdrsVal[0].itemsiteCode;
                            ddlCreatedBy_PoApprovedView.Value       = StkMovdocHdrsVal[0].contactPerson;
                            txt_termsOfPayment_PoApprovedView.Value = StkMovdocHdrsVal[0].terms;
                            txtRemark_PoApprovedView.Value          = StkMovdocHdrsVal[0].poRemk1;
                            txt_TotAmnt_PoApprovedView.Value        = StkMovdocHdrsVal[0].poTtqty;
                            txtTotQty_PoApprovedView.Value          = StkMovdocHdrsVal[0].poTtqty;
                            recStatus = StkMovdocHdrsVal[0].poStatus;
                        }
                        else
                        {
                            Console.WriteLine("Internal server Error");
                        }
                    }

                    List <poaPPDtls> StkMovdocDtlsValObj = JsonConvert.DeserializeObject <List <poaPPDtls> >(GetapiCalling("api/approvedOutletPODetailListS?filter={\"where\":{\"poNo\":\"" + _PKey + "\"}}"));
                    var StkMovdocDtlsVal = StkMovdocDtlsValObj.OrderBy(s => s.lineNumber).ToList();
                    if (StkMovdocDtlsVal.Count > 0 && PoApprovedViewEntryModule.Rows.Count == 1)
                    {
                        for (int i = 0; i < StkMovdocDtlsVal.Count; i++)
                        {
                            HtmlTableRow _Row = new HtmlTableRow();


                            HtmlTableCell Col_2 = new HtmlTableCell();
                            Col_2.Attributes.Add("style", "width: 5 %");
                            Col_2.InnerText = StkMovdocDtlsVal[i].lineNumber;
                            _Row.Controls.Add(Col_2);

                            HtmlTableCell Col_3 = new HtmlTableCell();
                            Col_3.Attributes.Add("style", "width: 10 %");
                            Col_3.InnerText = StkMovdocDtlsVal[i].podItemCode;
                            _Row.Controls.Add(Col_3);

                            HtmlTableCell Col_4 = new HtmlTableCell();
                            Col_4.Attributes.Add("style", "width: 20 %");
                            Col_4.InnerText = StkMovdocDtlsVal[i].podItemDesc;
                            _Row.Controls.Add(Col_4);

                            HtmlTableCell Col_5 = new HtmlTableCell();
                            Col_5.Attributes.Add("style", "width: 10 %");
                            Col_5.InnerText = StkMovdocDtlsVal[i].brandName;
                            _Row.Controls.Add(Col_5);

                            HtmlTableCell Col_6 = new HtmlTableCell();
                            Col_6.Attributes.Add("style", "width: 10 %");
                            Col_6.InnerText = StkMovdocDtlsVal[i].podItemPrice;
                            _Row.Controls.Add(Col_6);

                            HtmlTableCell Col_7 = new HtmlTableCell();
                            Col_7.Attributes.Add("style", "width: 10 %");
                            Col_7.InnerText = StkMovdocDtlsVal[i].podQty;
                            _Row.Controls.Add(Col_7);

                            HtmlTableCell Col_8 = new HtmlTableCell();
                            Col_8.Attributes.Add("style", "width: 10 %");
                            Col_8.InnerText = StkMovdocDtlsVal[i].poAppQty;
                            _Row.Controls.Add(Col_8);

                            PoApprovedViewEntryModule.Rows.Add(_Row);
                        }
                    }
                }
            }
            catch (Exception Ex)
            {
                oCommonEngine.SetAlert(this.Page, Ex.Message, Utilities.CommonEngine.MessageType.Error, Utilities.CommonEngine.MessageDuration.Medium);
            }
        }