protected void LoadSalesCenters()
        {
            SalesCenterBLL salesCenter = new SalesCenterBLL();

            try
            {
                DataTable dt = salesCenter.GetActiveSalesCenterListByUser();

                drpdwnSalesCenterOrWarehouse.DataSource = dt;
                drpdwnSalesCenterOrWarehouse.DataValueField = "SalesCenterId";
                drpdwnSalesCenterOrWarehouse.DataTextField = "SalesCenterName";
                drpdwnSalesCenterOrWarehouse.DataBind();
                //drpdwnSalesCenterOrWarehouse.Items.Insert(0, "");
                //drpdwnSalesCenterOrWarehouse.SelectedIndex = 0;

                drpdwnSalesCenterOrWarehouse.SelectedValue = LumexSessionManager.Get("UserSalesCenterId").ToString();

                if (dt.Rows.Count < 1)
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Joining Sales Center Data Not Found!!!"; msgDetailLabel.Text = "";
                    msgbox.Attributes.Add("class", "alert alert-warning");
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }
            finally
            {
                salesCenter = null;
            }
        }
Esempio n. 2
0
        public DataTable SaveSalesCenter(SalesCenterBLL salesCenter, LumexDBPlayer db)
        {
            try
            {
                db.AddParameters("@SalesCenterName", salesCenter.SalesCenterName.Trim());
                db.AddParameters("@Address", salesCenter.Address.Trim());
                db.AddParameters("@Country", salesCenter.Country.Trim());
                db.AddParameters("@City", salesCenter.City.Trim());
                db.AddParameters("@District", salesCenter.District.Trim());
                db.AddParameters("@PostalCode", salesCenter.PostalCode.Trim());
                db.AddParameters("@Phone", salesCenter.Phone.Trim());
                db.AddParameters("@Mobile", salesCenter.Mobile.Trim());
                db.AddParameters("@Fax", salesCenter.Fax.Trim());
                db.AddParameters("@Email", salesCenter.Email.Trim());
                db.AddParameters("@WarehouseId", salesCenter.WarehouseId.Trim());
                db.AddParameters("@CreatedBy", LumexSessionManager.Get("ActiveUserId").ToString());
                db.AddParameters("@CreatedFrom", LumexLibraryManager.GetTerminal());

                DataTable dt = db.ExecuteDataTable("INSERT_SALES_CENTER", true);
                return dt;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                salesCenter = null;
            }
        }
Esempio n. 3
0
        private void getTodaysTotalCashCreditSales()
        {
            SalesCenterBLL salesCenterBll = new SalesCenterBLL();
            try
            {
                string startdate = DateTime.Now.AddHours(14).ToString("dd/MM/yyyy");
                string EndDate = startdate;

                DataTable dt = salesCenterBll.getTotalCashCreditSalesByDateRange(startdate, EndDate, (string)LumexSessionManager.Get("ActiveUserId"));

                if (dt.Rows.Count > 0)
                {
                    lblTotalSales.Text = dt.Rows[0][0].ToString();
                    lblInCash.Text = dt.Rows[0][1].ToString();
                    lblInDue.Text = (Convert.ToDecimal(dt.Rows[0][0].ToString()) - Convert.ToDecimal(dt.Rows[0][1].ToString())).ToString();
                }
                else
                {
                    lblTotalSales.Text = "0.00";
                    lblInCash.Text = "0.00";
                    lblInDue.Text = "0.00";
                }
            }
            catch (Exception ex)
            {

                string message = ex.Message;
                if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");

            }
        }
        protected void GetSalesCenterList()
        {
            SalesCenterBLL salesCenter = new SalesCenterBLL();

            try
            {
                DataTable dt = salesCenter.GetSalesCenterList();

                if (dt.Rows.Count > 0)
                {
                    salesCenterListListBox.Items.Clear();

                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        salesCenterListListBox.Items.Add(new ListItem(dt.Rows[i]["SalesCenterName"].ToString(), dt.Rows[i]["SalesCenterId"].ToString()));
                    }
                }
                else
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Sales Center List Data Not Found!!!"; msgDetailLabel.Text = "";
                    msgbox.Attributes.Add("class", "alert alert-warning");
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }
            finally
            {
                salesCenter = null;
                countSalesCenterLabel.Text = "Total: " + salesCenterListListBox.Items.Count.ToString();
            }
        }
        protected void LoadSCWH()
        {
            SalesCenterBLL salesCenter = new SalesCenterBLL();
            WarehouseBLL warehouse = new WarehouseBLL();
            DataTable dt = new DataTable();

            try
            {
                //if (reportTypeDropDownList.SelectedValue == "Sales Center")
                //{
                //    dt = salesCenter.GetActiveSalesCenterListByUser();

                //    SCWHDropDownList.DataSource = dt;
                //    SCWHDropDownList.DataValueField = "SalesCenterId";
                //    SCWHDropDownList.DataTextField = "SalesCenterName";
                //    SCWHDropDownList.DataBind();
                //    SCWHDropDownList.Items.Insert(0, "All");
                //    SCWHDropDownList.Items[0].Value = "All";
                //    SCWHDropDownList.SelectedIndex = 0;
                //}
                
                
                    dt = warehouse.GetActiveWarehouseListByUser();

                    SCWHDropDownList.DataSource = dt;
                    SCWHDropDownList.DataValueField = "WarehouseId";
                    SCWHDropDownList.DataTextField = "WarehouseName";
                    SCWHDropDownList.DataBind();
                    SCWHDropDownList.Items.Insert(0, "All");
                    SCWHDropDownList.Items[0].Value = "All";
                    SCWHDropDownList.SelectedIndex = 0;
                

                //SCWHDropDownList.SelectedValue = LumexSessionManager.Get("UserSalesCenterId").ToString();

                if (dt.Rows.Count < 1)
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Joining Sales Center Data Not Found!!!"; msgDetailLabel.Text = "";
                    msgbox.Attributes.Add("class", "alert alert-warning");
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }
            finally
            {
                salesCenter = null;
                warehouse = null;
            }
        }
        protected void LoadUserInfoAndSalesCenterList(string userId)
        {
            UserBLL user = new UserBLL();
            SalesCenterBLL salesCenter = new SalesCenterBLL();

            try
            {
                DataTable dt = user.GetUserById(userId);

                if (dt.Rows.Count > 0)
                {
                    userIdLabel.Text = dt.Rows[0]["UserId"].ToString();
                    userNameLabel.Text = dt.Rows[0]["UserName"].ToString();
                    employeeIdLabel.Text = dt.Rows[0]["EmployeeId"].ToString();
                    userGroupNameLabel.Text = dt.Rows[0]["UserGroupName"].ToString();
                    activeStatusLabel.Text = dt.Rows[0]["IsActive"].ToString();

                    userSalesCenterListListBox.Items.Clear();
                    DataTable dtSalesCenter = salesCenter.GetUserSalesCentersByUserId(userIdLabel.Text.Trim());

                    for (int i = 0; i < dtSalesCenter.Rows.Count; i++)
                    {
                        userSalesCenterListListBox.Items.Add(new ListItem(dtSalesCenter.Rows[i]["SalesCenterName"].ToString(), dtSalesCenter.Rows[i]["SalesCenterId"].ToString()));
                    }

                    userPriviligePane.Visible = true;
                }
                else
                {
                    userPriviligePane.Visible = false;
                    msgbox.Visible = true; msgTitleLabel.Text = "User Data Not Found!!!"; msgDetailLabel.Text = "";
                    msgbox.Attributes.Add("class", "alert alert-warning");
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }
            finally
            {
                user = null;
                salesCenter = null;
                countUserSalesCenterLabel.Text = "Total: " + userSalesCenterListListBox.Items.Count.ToString();
            }
        }
        protected void LoadTransferToItems(string transferDestination)
        {
            SalesCenterBLL salesCenter = new SalesCenterBLL();
            WarehouseBLL warehouse = new WarehouseBLL();

            try
            {
                if (transferDestination == "WH")
                {
                    DataTable dt = warehouse.GetActiveWarehouseList();

                    transferToDropDownList.DataSource = dt;
                    transferToDropDownList.DataValueField = "WarehouseId";
                    transferToDropDownList.DataTextField = "WarehouseName";
                    transferToDropDownList.DataBind();
                    transferToDropDownList.Items.Insert(0, "");
                }
                else if (transferDestination == "SC")
                {
                    DataTable dt = salesCenter.GetActiveSalesCenterList();

                    transferToDropDownList.DataSource = dt;
                    transferToDropDownList.DataValueField = "SalesCenterId";
                    transferToDropDownList.DataTextField = "SalesCenterName";
                    transferToDropDownList.DataBind();
                    transferToDropDownList.Items.Insert(0, "");
                }
                else
                {
                    transferToDropDownList.Items.Clear();
                }
            }
            catch (Exception ex)
            {
                msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message;
            }
            finally
            {
                salesCenter = null;
                warehouse = null;
            }
        }
        protected void LoadSalesCenters()
        {
            SalesCenterBLL salesCenter = new SalesCenterBLL();

            try
            {
                DataTable dt = salesCenter.GetActiveSalesCenterListByUser();

                salesCenterDropDownList.DataSource = dt;
                salesCenterDropDownList.DataValueField = "SalesCenterId";
                salesCenterDropDownList.DataTextField = "SalesCenterName";
                salesCenterDropDownList.DataBind();
                salesCenterDropDownList.Items.Insert(0, "All");
                salesCenterDropDownList.SelectedIndex = 0;
            }
            catch (Exception ex)
            {
                msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message;
            }
            finally
            {
                salesCenter = null;
            }
        }
        protected void saveButton_Click(object sender, EventArgs e)
        {
            SalesCenterBLL salesCenter = new SalesCenterBLL();
            List<string> salesCenters = new List<string>();

            try
            {
                for (int i = 0; i < userSalesCenterListListBox.Items.Count; i++)
                {
                    salesCenters.Add(userSalesCenterListListBox.Items[i].Value.Trim());
                }

                salesCenter.SaveUserSalesCentersByUserId(userIdLabel.Text.Trim(), salesCenters);

                string message = "User's Sales Center List <span class='actionTopic'>Saved</span> Successfully.";
                MyAlertBox("var callbackOk = function () { MyOverlayStart(); window.location = \"/UI/UserPrivilege/PrivilegeUserList.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", callbackOk);");
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }
            finally
            {
                salesCenter = null;
                salesCenters = null;
            }
        }
        protected void LoadTransferFromToItems(string transferType)
        {
            SalesCenterBLL salesCenter = new SalesCenterBLL();
            WarehouseBLL warehouse = new WarehouseBLL();

            try
            {
                //if (transferType == "WH-WH")
                //{
                //    DataTable dt = warehouse.GetActiveWarehouseListByUser();

                //    transferFromDropDownList.DataSource = dt;
                //    transferFromDropDownList.DataValueField = "WarehouseId";
                //    transferFromDropDownList.DataTextField = "WarehouseName";
                //    transferFromDropDownList.DataBind();
                //    transferFromDropDownList.Items.Insert(0, "");
                //    transferFromDropDownList.SelectedIndex = 0;

                //    transferToDropDownList.DataSource = dt;
                //    transferToDropDownList.DataValueField = "WarehouseId";
                //    transferToDropDownList.DataTextField = "WarehouseName";
                //    transferToDropDownList.DataBind();
                //    transferToDropDownList.Items.Insert(0, "");
                //    transferToDropDownList.SelectedIndex = 0;
                //}
                //else 
                if (transferType == "WH-SC")
                {
                    DataTable dt = salesCenter.GetActiveSalesCenterListByUser();

                    salesCenterDropDownList.DataSource = dt;
                    salesCenterDropDownList.DataValueField = "SalesCenterId";
                    salesCenterDropDownList.DataTextField = "SalesCenterName";
                    salesCenterDropDownList.DataBind();
                    salesCenterDropDownList.Items.Insert(0, "Select Please...");
                    salesCenterDropDownList.SelectedIndex = 0;
                    salesCenterDropDownList.SelectedValue = LumexSessionManager.Get("UserSalesCenterId").ToString();


                }
                //else if (transferType == "SC-SC")
                //{
                //    DataTable dt = salesCenter.GetActiveSalesCenterListByUser();

                //    transferFromDropDownList.DataSource = dt;
                //    transferFromDropDownList.DataValueField = "SalesCenterId";
                //    transferFromDropDownList.DataTextField = "SalesCenterName";
                //    transferFromDropDownList.DataBind();
                //    transferFromDropDownList.Items.Insert(0, "");
                //    transferFromDropDownList.SelectedIndex = 0;

                //    transferToDropDownList.DataSource = dt;
                //    transferToDropDownList.DataValueField = "SalesCenterId";
                //    transferToDropDownList.DataTextField = "SalesCenterName";
                //    transferToDropDownList.DataBind();
                //    transferToDropDownList.Items.Insert(0, "");
                //    transferToDropDownList.SelectedIndex = 0;
                //}
                else if (transferType == "SC-WH")
                {


                    DataTable dt = warehouse.GetActiveWarehouseListByUser();


                    salesCenterDropDownList.DataSource = dt;
                    salesCenterDropDownList.DataValueField = "WarehouseId";
                    salesCenterDropDownList.DataTextField = "WarehouseName";
                    salesCenterDropDownList.DataBind();
                    salesCenterDropDownList.Items.Insert(0, "Select Please...");
                    salesCenterDropDownList.SelectedIndex = 0;
                    salesCenterDropDownList.SelectedValue = LumexSessionManager.Get("UserWareHouseId").ToString();

                }
                else
                {
                    salesCenterDropDownList.Items.Clear();

                }
            }
            catch (Exception ex)
            {
                msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message;
            }
            finally
            {
                salesCenter = null;
                warehouse = null;
            }
        }
Esempio n. 11
0
 internal DataTable UpdateSalesCenterNotificationLimit(SalesCenterBLL salesCenterBLL, LumexDBPlayer db)
 {  
     try
     {
         db.AddParameters("@Value", salesCenterBLL.StockLimit);
         db.AddParameters("@Key","SSL");
         DataTable dt = db.ExecuteDataTable("UPDATE_APP_SETTING_BY_KEY", true);
         return dt;
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 12
0
        public void UpdateSalesCenter(SalesCenterBLL salesCenter, LumexDBPlayer db)
        {
            try
            {
                db.AddParameters("@SalesCenterId", salesCenter.SalesCenterId.Trim());
                db.AddParameters("@SalesCenterName", salesCenter.SalesCenterName.Trim());
                db.AddParameters("@Address", salesCenter.Address.Trim());
                db.AddParameters("@Country", salesCenter.Country.Trim());
                db.AddParameters("@City", salesCenter.City.Trim());
                db.AddParameters("@District", salesCenter.District.Trim());
                db.AddParameters("@PostalCode", salesCenter.PostalCode.Trim());
                db.AddParameters("@Phone", salesCenter.Phone.Trim());
                db.AddParameters("@Mobile", salesCenter.Mobile.Trim());
                db.AddParameters("@Fax", salesCenter.Fax.Trim());
                db.AddParameters("@Email", salesCenter.Email.Trim());
                db.AddParameters("@WarehouseId", salesCenter.WarehouseId.Trim());
                db.AddParameters("@ModifiedBy", LumexSessionManager.Get("ActiveUserId").ToString());
                db.AddParameters("@ModifiedFrom", LumexLibraryManager.GetTerminal());

                db.ExecuteNonQuery("UPDATE_SALES_CENTER_BY_ID", true);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                salesCenter = null;
            }
        }
Esempio n. 13
0
        private void getSalesCenterName(string salesCenterId)
        {
            try
            {
                SalesCenterBLL salesCenter = new SalesCenterBLL();
                DataTable dt = salesCenter.GetSalesCenterById(salesCenterId);
                // lblSalesCenterName.Text = dt.Rows[0][2].ToString();
            }
            catch (Exception)
            {


            }
        }