Esempio n. 1
0
        public void EditorMode()
        {
            User u = GetCurrentUser();

            u.GetPermissions();
            //проверяем наличие прав для редактировнаия
            if (u.ChekPermission("Editor"))
            {
                punAdonentEditor.Visible = true;
                gvJournal.Visible        = false;
                gvJournal2.Visible       = true;
                BindDistricts();
                UniversalEntity ue   = new UniversalEntity();
                NewFAbonent     fa   = new NewFAbonent();
                NewFAbonentDO   fado = new NewFAbonentDO();
                ue = fado.RetrieveByOrderID(_OrderID);
                if (ue.Count > 0)
                {
                    fa = (NewFAbonent)ue[0];
                    tbNumberJournalPhysical.Text = fa.PhysicalNumberJournal;
                    tbAddress.Text            = fa.Address;
                    tbClientSurname.Text      = fa.Surname;
                    ddlDistrict.SelectedValue = fa.DistrictID.ToString();
                    tbClientName.Text         = fa.FirstName;
                    tbClientLastName.Text     = fa.LastName;
                    tbPhone.Text     = fa.Phone;
                    cbNotPay.Checked = fa.NotPay;
                    //cbRejectVodomer.Checked = fa.RejectVodomer;
                }
                NewFOrder   fo    = new NewFOrder();
                NewFOrderDO fodDO = new NewFOrderDO();
                ue = fodDO.RetrieveFOrderById(_OrderID);
                if (ue.Count > 0)
                {
                    fo = (NewFOrder)ue[0];
                    cbDefectVodomer.Checked = fo.DefectVodomer;
                }
            }
            else
            {
                punAdonentEditor.Visible = false;
                gvJournal.Visible        = true;
                gvJournal2.Visible       = false;
            }
        }
Esempio n. 2
0
        public void Bind()
        {
            EditorMode();
            cbSeld.Checked          = false;
            cbSeld.Enabled          = true;
            cbPaid.Checked          = false;
            cbPaid.Enabled          = true;
            cbRejectVodomer.Checked = false;
            cbRejectVodomer.Enabled = true;
            cbDefectVodomer.Checked = false;
            cbDefectVodomer.Enabled = true;


            tbPaymentDay.Enabled = true;
            tbPaymentDay.Text    = DateTime.Now.ToShortDateString();


            NewFOrder   fo   = new NewFOrder();
            NewFOrderDO fodo = new NewFOrderDO();
            //StringBuilder sbl = new StringBuilder();
            UniversalEntity ue = new UniversalEntity();

            ue = fodo.RetrieveFOrderById(_OrderID);
            if (ue.Count > 0)
            {
                fo = (NewFOrder)ue[0];

                if (fo.DateOut != null)
                {
                    cbSeld.Checked = true;
                    cbSeld.Enabled = false;
                    cbPaid.Checked = true;
                    cbPaid.Enabled = false;
                }
                if (fo.IsPaid)
                {
                    cbPaid.Checked = true;
                    cbPaid.Enabled = false;
                    cbSeld.Checked = true;
                    cbSeld.Enabled = false;
                    if (fo.PaymentDay.HasValue)
                    {
                        tbPaymentDay.Text = fo.PaymentDay.Value.ToShortDateString();
                    }
                    tbPaymentDay.Enabled = false;
                }
                if (fo.DefectVodomer)
                {
                    cbDefectVodomer.Checked = true;
                    cbDefectVodomer.Enabled = false;
                }
            }


            hfODID.Value = _OrderID.ToString();
            StringBuilder sb   = new StringBuilder();
            NewFAbonent   fa   = new NewFAbonent();
            NewFAbonentDO fado = new NewFAbonentDO();

            ue = fado.RetrieveByOrderID(_OrderID);
            if (ue.Count > 0)
            {
                fa = (NewFAbonent)ue[0];
                if (fa.NotPay)
                {
                    cbPaid.Enabled      = false;
                    btActRubNew.Enabled = false;
                    //btPay.Enabled = false;
                    //btOrder.Enabled = false;
                    //btOrderCheck.Enabled = false;
                    btNewActCheckRub.Enabled = false;
                    //btWithdrawalAct.Enabled = false;
                }
                sb.AppendLine("<span>ФИО: " + fa.Surname + " " + fa.FirstName + " " + fa.LastName + "</span><br/>");
                sb.AppendLine("<span>номер по журналу: " + fa.PhysicalNumberJournal + "</span><br/>");
                sb.AppendLine("<span>Тел.: " + fa.Phone + "</span><br/>");
                sb.AppendLine("<span>Адрес: " + fa.Address + "</span><br/>");
                if (fa.NotPay)
                {
                    sb.AppendLine("<span style=\"color:red;font-size:18px;\">Без оплаты</span><br/>");
                }



                litAbonentInfo2018.Text = sb.ToString();
            }
        }