예제 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Debuging.Info("UsersList Page_Load");
     if (!Page.IsPostBack)
     {
         Session["Result"] = gridList.DataSource = new UserRepository().GetAll().OrderBy(a => a.FriendlyName).ToList();
         gridList.DataBind();
     }
 }
예제 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Debuging.Info("ProcessCategoryList Page_Load");
     if (!Page.IsPostBack)
     {
         Session["Result"] = gridList.DataSource = new ProcessCategoryRepository().GetGroupedList().OrderBy(a => a.CategoryName).ToList();
         gridList.DataBind();
     }
 }
예제 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Debuging.Info("Start of Main.master.cs");

            if (Environment.MachineName.ToLower() == "DESKTOP-6700VR9".ToLower())
            {
                Session["User"] = new UserRepository().GetById(1);
            }

            if (Session["User"] == null)
            {
                Response.RedirectToRoute("Login");
            }

            var user = (User)Session["User"];

            if (user != null)
            {
                lblCurrentUser.Text = "کاربر:" + user.FriendlyName;
                hfUserId.Value      = user.Id.ToString();
            }

            if (Session["PostProcessMessage"] != null)
            {
                var postPrMsg = (PostProcessMessage)Session["PostProcessMessage"];
                SetGeneralMessage(postPrMsg.Message, postPrMsg.MessageType);
                Session["PostProcessMessage"] = null;
            }

            if (Session["User"] != null && ((User)Session["User"]).Username == "inoutop")
            {
                var items = GetControlHierarchy(mainMenuDiv);
                foreach (var item in items)
                {
                    item.Visible = false;
                }

                mainMenuDiv.Visible          = true;
                lbtnCategories.Visible       = true;
                lbtnProducts.Visible         = true;
                lbtnIn.Visible               = true;
                lbtnOut.Visible              = true;
                lbtnReportIn.Visible         = true;
                lbtnReportOut.Visible        = true;
                lbtnGoodsSupply.Visible      = true;
                lbtnCardex.Visible           = true;
                lbtnGoodsGroupSupply.Visible = true;
                lbtnUsers.Visible            = true;
                lbtnCustomers.Visible        = true;
                lbtnExit.Visible             = true;
            }
        }
예제 #4
0
        //public List<KeyValuePair<int, string>> PaymentTypeList
        //{
        //    get
        //    {
        //        var values = Enum.GetValues(typeof (PaymentTypeEnum)).Cast<int>();

        //        var result = new List<KeyValuePair<int, string>>();

        //        foreach (int item in values)
        //        {
        //            result.Add(new KeyValuePair<int, string>(item,Enum.GetName(typeof(PaymentTypeEnum),item)));
        //        }

        //        return result;
        //    }
        //}

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Environment.MachineName.ToLower() == "arash-laptop")
            {
                Session["User"] = new BaseRepository <User>().GetById(1);
            }

            try
            {
                Debuging.Info("Payment->Try to Page_Load");

                if (!Page.IsPostBack)
                {
                    BindDrpFactor();

                    if (Page.RouteData.Values["Id"].ToSafeInt() != 0)
                    {
                        var paymentId = Page.RouteData.Values["Id"].ToSafeInt();

                        var paymentRepo = new PaymentRepository();
                        var payment     = paymentRepo.GetById(paymentId);

                        txtDescription.Text     = payment.Description;
                        txtPaymentNo.Text       = payment.PaymentNo.ToString();
                        drpFactor.SelectedValue = payment.FactorId.ToString();
                        drpFactor_OnSelectedIndexChanged(sender, new RadComboBoxSelectedIndexChangedEventArgs("", "", payment.FactorId.ToString(), ""));
                        ucDate.Date = payment.PaymentDate.ToFaDate();
                        var paymentDetailRepo = new PaymentDetailRepository();

                        gridPayment.DataSource = Session["GridSource"] = paymentDetailRepo.GetPaymentDetails(paymentId);
                        gridPayment.DataBind();
                    }
                    else
                    {
                        ucDate.Date            = DateTime.Now.ToFaDate();
                        gridPayment.DataSource = Session["GridSource"] = new List <PaymentDetail>();
                        gridPayment.DataBind();

                        txtPaymentNo.Text = (new PaymentRepository().GetMaxPaymentNo() + 1).ToString();
                    }
                }
            }
            catch (Exception ex)
            {
                Debuging.Error(ex, MethodBase.GetCurrentMethod().Name);
            }
            Debuging.Info("Payment->End of Page_Load");
        }
예제 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                Debuging.Info("Factor->Try to Page_Load");

                if (!Page.IsPostBack)
                {
                    BindDrpCustomer();

                    if (Page.RouteData.Values["Id"].ToSafeInt() != 0)
                    {
                        var factorId = Page.RouteData.Values["Id"].ToSafeInt();

                        var factorRepo = new FactorRepository();
                        var factor     = factorRepo.GetById(factorId);

                        txtFactorNumber.Text      = factor.FactorNo.ToString();
                        txtDescription.Text       = factor.Description;
                        drpCustomer.SelectedValue = factor.CustomerId.ToString();
                        txtDate.Text = factor.FactorDate.ToFaDate();

                        var factorDetailRepo = new FactorDetailRepository();

                        gridFactor.DataSource = Session["GridSource"] = factorDetailRepo.GetFactorDetails(factorId);
                        gridFactor.DataBind();
                    }
                    else
                    {
                        txtDate.Text          = DateTime.Now.ToFaDate();
                        gridFactor.DataSource = Session["GridSource"] = new List <FactorDetail>();
                        gridFactor.DataBind();

                        txtFactorNumber.Text = (new FactorRepository().GetMaxFactorNo() + 1).ToString();
                    }

                    //BindFooterGoodsUnitDrp();
                }
            }
            catch (Exception ex)
            {
                Debuging.Error(ex, MethodBase.GetCurrentMethod().Name);
            }
            Debuging.Info("Factor->End of Page_Load");
        }