Exemplo n.º 1
0
        //---------------------------------------------------------Proposal Status---------------------------------------------------------------------------

        private void btnStatsProp_Click(object sender, EventArgs e)
        {
            pnlProposal.Visible = false;
            pnlRequest.Visible  = false;
            pnlApprove.Visible  = true;

            DataTable DtStats = new DataTable();

            DtStats = DBMethods.BindProposalStatus("");
            dgvProposalStatus.Rows.Clear();
            txtSearch.Text = string.Empty;

            if (DtStats.Rows.Count > 0)
            {
                for (int ss = 0; ss <= DtStats.Rows.Count - 1; ss++)
                {
                    dgvProposalStatus.Rows.Add(new object[] { imageList1.Images[2], DtStats.Rows[ss]["pID"].ToString(), DtStats.Rows[ss]["RPRNum"].ToString(), DtStats.Rows[ss]["PProp"].ToString(),
                                                              DtStats.Rows[ss]["PVendorName"].ToString(), DtStats.Rows[ss]["PItem"].ToString(), DtStats.Rows[ss]["PQty"].ToString(),
                                                              DtStats.Rows[ss]["PStatus"].ToString(),
                                                              DtStats.Rows[ss]["PStatus"].ToString() == "" ? imageList1.Images[4] : imageList1.Images[3],
                                                              string.Format("{0:#,#}", Convert.ToDecimal(DtStats.Rows[ss]["PCost"])) });
                    Application.DoEvents();
                }
            }
        }
        public ActionResult Edit(Item obj)
        {
            int affected = 0;

            affected = DBMethods.EditItem(obj);
            return(RedirectToAction("Index"));
        }
Exemplo n.º 3
0
        void RefreshPurchaseView()
        {
            DataTable DtPurchase = new DataTable();

            DtPurchase = DBMethods.PurchaseStatusBind("purchase");
            dgvStatsPurchase.Rows.Clear();

            if (DtPurchase.Rows.Count > 0)
            {
                for (int i = 0; i <= DtPurchase.Rows.Count - 1; i++)
                {
                    dgvStatsPurchase.Rows.Add(new object[] { imageList1.Images[0], DtPurchase.Rows[i]["StatsID"].ToString(), DtPurchase.Rows[i]["PRFID"].ToString(),
                                                             DtPurchase.Rows[i]["PONumber"].ToString(), Convert.ToDateTime(DtPurchase.Rows[i]["Purchase_Date"]).ToString("MMM dd, yyyy"),
                                                             DtPurchase.Rows[i]["RAccount"].ToString(), DtPurchase.Rows[i]["RDesc"].ToString(),
                                                             DtPurchase.Rows[i]["PTerms"].ToString(),
                                                             DtPurchase.Rows[i]["PO_Status"].ToString().ToLower() == "ongoing" ? imageList1.Images[2] :
                                                             DtPurchase.Rows[i]["PO_Status"].ToString().ToLower() == "delivered" ? imageList1.Images[4] : imageList1.Images[3],
                                                             DtPurchase.Rows[i]["PO_Status"].ToString().ToLower() == "delivered" ?
                                                             Convert.ToDateTime(DtPurchase.Rows[i]["Status_Date"]).ToString("MMM dd, yyyy") : "",
                                                             DtPurchase.Rows[i]["Paid_Date"].ToString() == "" ? "" :
                                                             Convert.ToDateTime(DtPurchase.Rows[i]["Paid_Date"]).ToString("MMM dd, yyyy"),
                                                             DtPurchase.Rows[i]["Bill"].ToString() == "" ? imageList1.Images[3] : imageList1.Images[1],
                                                             DtPurchase.Rows[i]["CountTerms"].ToString(), DtPurchase.Rows[i]["Pbit"].ToString(), DtPurchase.Rows[i]["Bill"].ToString() });

                    Application.DoEvents();
                }
            }
        }
Exemplo n.º 4
0
        FlowLayoutPanel AddAnswerToPanel(int queryid)
        {
            DBMethods       db = new DBMethods();
            List <Form_Ans> form_answer_list = db.GetQueryAnswer(queryid);
            FlowLayoutPanel flpanel          = new FlowLayoutPanel();

            foreach (Form_Ans form_answer in form_answer_list)
            {
                #region Panel
                flpanel.FlowDirection = FlowDirection.TopDown;
                flpanel.AutoSize      = true;
                flpanel.AutoSizeMode  = AutoSizeMode.GrowAndShrink;
                flpanel.WrapContents  = true;
                flpanel.Dock          = DockStyle.Fill;
                flpanel.Name          = FlowPanelName;
                #endregion

                RadioButton box = new RadioButton();
                box.Text     = form_answer.Answer;
                box.AutoSize = true;
                box.Dock     = System.Windows.Forms.DockStyle.Fill;
                box.Tag      = form_answer;
                flpanel.Controls.Add(box);
            }

            return(flpanel);
        }
Exemplo n.º 5
0
        private void FieldI_TextChanged(object sender, TextChangedEventArgs e)
        {
            DBMethods met = new DBMethods();

            dataGridImmeuble.ItemsSource = null;
            switch (((TextBox)sender).Name)
            {
            case "FieldINumero":
                dataGridImmeuble.ItemsSource = met.getListImm(FieldINumero.Text, 2);
                break;

            case "FieldIVoix":
                dataGridImmeuble.ItemsSource = met.getListImm(FieldIVoix.Text, 4);
                break;

            case "FieldIAdresse":
                dataGridImmeuble.ItemsSource = met.getListImm(FieldIAdresse.Text, 3);
                break;

            case "FieldICodePostal":
                dataGridImmeuble.ItemsSource = met.getListImm(FieldICodePostal.Text, 5);
                break;

            case "FieldIVille":
                dataGridImmeuble.ItemsSource = met.getListImm(FieldIVille.Text, 6);
                break;

            default:
                break;
            }
        }
Exemplo n.º 6
0
        private void rbRequest_CheckedChanged(object sender, EventArgs e)
        {
            dgvStatsRequest.Visible  = true;
            bScrollStats.Visible     = true;
            dgvStatsPurchase.Visible = false;
            bScrollPurchase.Visible  = false;
            bHScrollPurchase.Visible = false;

            DataTable DtStats = new DataTable();

            DtStats = DBMethods.PurchaseStatusBind("request");
            dgvStatsRequest.Rows.Clear();

            if (DtStats.Rows.Count > 0)
            {
                for (int i = 0; i <= DtStats.Rows.Count - 1; i++)
                {
                    dgvStatsRequest.Rows.Add(new object[] { imageList1.Images[0], DtStats.Rows[i]["PRFID"].ToString(), DtStats.Rows[i]["RPRNum"].ToString(),
                                                            DtStats.Rows[i]["RName"].ToString(), DtStats.Rows[i]["RAccount"].ToString(),
                                                            DtStats.Rows[i]["RDesc"].ToString(), Convert.ToDateTime(DtStats.Rows[i]["RDate"]).ToString("MMM dd, yyyy") });

                    Application.DoEvents();
                }
            }
        }
Exemplo n.º 7
0
        protected void CreateNewAccount_Click(object sender, EventArgs e)
        {
            //Register New Customer Validation PT  2

            // disable unobtrusive validation
            UnobtrusiveValidationMode =
                System.Web.UI.UnobtrusiveValidationMode.None;

            // if this is not the first time the page is loading
            // (i.e., the user has already submitted form data)
            if (IsPostBack)
            {
                Page.Validate("RegisterNewCustomerValidation");  // validate the form

                // if the form is valid
                if (IsValid)
                {
                    // retrieve the values submitted by the user
                    string validName        = txtCustomerName.Text;
                    string validPhoneNUmber = txtCustomerPhone.Text;

                    // show the submitted values                                       ///  seems to want the whole page to be valid to carry out next command !!
                    GordTestLabelNewCustomer.Text = validName + " " + validPhoneNUmber;
                } // end if
            }
            string name    = txtCustomerName.Text;
            string country = ddlCountry.SelectedItem.ToString();
            string phone   = txtCustomerPhone.Text;

            DBMethods.CreateNewCustomer(customerEmail, country, name, phone);
            BookingIDReference.InnerHtml = bookingID.ToString();
        }
Exemplo n.º 8
0
        public frmUsers()
        {
            InitializeComponent();

            pnlList.Visible   = true;
            pnlCreate.Visible = false;

            DataTable DtUsers = new DataTable();

            DtUsers = DBMethods.GetUsersCredentialsList();
            dgvUsers.Rows.Clear();

            if (DtUsers.Rows.Count > 0)
            {
                for (int i = 0; i <= DtUsers.Rows.Count - 1; i++)
                {
                    dgvUsers.Rows.Add(new object[] { imageList1.Images[0], DtUsers.Rows[i]["ID"].ToString(), DtUsers.Rows[i]["Username"].ToString(),
                                                     DtUsers.Rows[i]["Password"].ToString(), DtUsers.Rows[i]["Email"].ToString(), DtUsers.Rows[i]["Active"].ToString(),
                                                     DtUsers.Rows[i]["Active"].ToString() == "True" ? imageList1.Images[3] : imageList1.Images[4], DtUsers.Rows[i]["Rights"].ToString(),
                                                     imageList1.Images[1], imageList1.Images[2] });

                    Application.DoEvents();
                }
            }
        }
Exemplo n.º 9
0
        void DashboardPO(string month, string year)
        {
            DataTable DtPO = new DataTable();

            DtPO = DBMethods.DashBoardTotalPO(month, year);

            if (DtPO.Rows.Count > 0)
            {
                lblTotalPO.Text     = DtPO.Rows[0]["TotalPO"].ToString();
                lblOngoingPO.Text   = DtPO.Rows[0]["TotalOngoing"].ToString();
                lblCancelPO.Text    = DtPO.Rows[0]["TotalCancelled"].ToString();
                lblDeliveredPO.Text = DtPO.Rows[0]["TotalDelivered"].ToString();

                if (DtPO.Rows[0]["TotalPO"].ToString() == "0")
                {
                    progressPO.MaxValue = 1;
                    progressPO.Value    = 0;
                }
                else
                {
                    progressPO.MaxValue = Convert.ToInt32(DtPO.Rows[0]["TotalPO"]);
                    progressPO.Value    = Convert.ToInt32(DtPO.Rows[0]["TotalDelivered"]);
                }
            }
        }
Exemplo n.º 10
0
        public string Post(VW_Person person)
        {
            try
            {
                DBMethods dBMethods = new DBMethods();
                person.BusinessEntityID = dBMethods.PostBusinessEntity(person.ContactTypeName);
                dBMethods.PostPerson(person);
                if (person.PhoneNumber != null)
                {
                    dBMethods.PostPhoneNumber(person);
                }
                if (person.EmailAddress != null)
                {
                    dBMethods.PostEmailAddress(person);
                }
                if (person.PasswordHash != null)
                {
                    dBMethods.PostPassword(person);
                }

                return("Business Entities added successfully with Business Entity ID - " + person.BusinessEntityID.ToString());
            }
            catch (Exception e)
            {
                return("Exception occured." + e.Message);
            }
        }
Exemplo n.º 11
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string user_rights = string.Empty;

            if (txtUsername.Text == string.Empty || txtPassword.Text == string.Empty)
            {
                MessageBox.Show("Kindly input all fields for your credentials", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (DBMethods.GetUserLogin(txtUsername.Text, txtPassword.Text, ref user_rights))
            {
                InformationDetails.Username    = txtUsername.Text;
                InformationDetails.Credentials = user_rights;

                frmMain frmMain = new frmMain();
                this.Hide();
                frmMain.ShowDialog();
                this.Close();
            }
            else
            {
                MessageBox.Show("User not registered!", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Exemplo n.º 12
0
 protected void btnCheckExisting_Click(object sender, EventArgs e)
 {
     Page.Validate("CustomerCheck");
     if (Page.IsValid)
     {
         string email    = txtEmail.Text.ToString();
         var    customer = DBMethods.CheckExistingCustomer(email);
         if (customer.GetType() == typeof(string))
         {
             existingCustomer            = false;
             NotExistingCustomer.Visible = true;
             lblCustomerName.CssClass    = "show";
             txtCustomerName.Text        = string.Empty;
             txtCustomerName.CssClass    = "show";
             lblCustomerPhone.CssClass   = "show";
             txtCustomerPhone.Text       = string.Empty;
             txtCustomerPhone.CssClass   = "show";
             lblCustomerCountry.CssClass = "show";
             ddlCountry.SelectedIndex    = 0;
             ddlCountry.CssClass         = "show";
             MakeBooking.CssClass        = "show";
             UpdatePanelRegisterNewCustomer.Update();
         }
         else
         {
             if (IsPostBack)
             {
                 NotExistingCustomer.Visible = false;
                 existingCustomer            = true;
                 txtCustomerName.Text        = customer.CustomerName.ToString();
                 txtCustomerPhone.Text       = customer.CustomerPhone.ToString();
                 //ddlCountry.SelectedIndex = ddlCountry.Items.IndexOf(ddlCountry.Items.FindByValue(customer.CustomerCountry));
                 ddlCountry.SelectedValue    = customer.CustomerCountry;
                 lblCustomerName.CssClass    = "show";
                 txtCustomerName.CssClass    = "show";
                 lblCustomerPhone.CssClass   = "show";
                 txtCustomerPhone.CssClass   = "show";
                 lblCustomerCountry.CssClass = "show";
                 ddlCountry.CssClass         = "show";
                 MakeBooking.CssClass        = "show";
             }
         }
     }
     else
     {
         NotExistingCustomer.Visible = false;
         lblCustomerName.CssClass    = "hidden";
         txtCustomerName.Text        = string.Empty;
         txtCustomerName.CssClass    = "hidden";
         lblCustomerPhone.CssClass   = "hidden";
         txtCustomerPhone.Text       = string.Empty;
         txtCustomerPhone.CssClass   = "hidden";
         lblCustomerCountry.CssClass = "hidden";
         ddlCountry.SelectedIndex    = 0;
         ddlCountry.CssClass         = "hidden";
         MakeBooking.CssClass        = "hidden";
         UpdatePanelRegisterNewCustomer.Update();
     }
 }
        //Get Item List in JSON Format
        public JsonResult ItemJSONData()
        {
            var itemList = DBMethods.GetItemList();

            // var jsondata = JsonConvert.SerializeObject(itemList);
            // return Json(jsondata, JsonRequestBehavior.AllowGet);
            return(Json(itemList, JsonRequestBehavior.AllowGet));
        }
        public ActionResult ItemLOVDemo()
        {
            var        itemList = DBMethods.GetItemList();
            SelectList Items    = new SelectList(itemList, "Id", "Name");

            ViewBag.ItemList = Items;
            return(View());
        }
        //[HttpPost]
        public ActionResult Delete(int Id)
        {
            int affected = 0;

            affected = DBMethods.DeleteItem(Id);

            return(RedirectToAction("Index"));
        }
        private void BtnRemove_Click(object sender, EventArgs e)
        {
            int employeeID = DBMethods.GetUserID(listBoxEmployees.Text);

            DBMethods.RemoveEmployee(UserID, employeeID);
            UpdateListBoxEmployee();
            fmc.UpdateEmployees();
        }
Exemplo n.º 17
0
        protected void UpdateDB()
        {
            DBMethods       db   = new DBMethods();
            List <Currency> list = SetCurrency();

            foreach (Currency cur in list)
            {
                db.SaveCurrency(cur);
            }
        }
Exemplo n.º 18
0
        private void NewDay()
        {
            List <string> idsMarkedCompleted = DBMethods.GetSchedulerItems(GetKey());

            PurposedlyStoppedIds.Clear();
            for (int n = 0; n < SchedulerItems.Count; n++)
            {
                SchedulerItems[n].MarkedComplete = idsMarkedCompleted.Contains(SchedulerItems[n].Id);
                SchedulerItems[n].TC             = null;
            }
        }
Exemplo n.º 19
0
 public ActionResult Save([FromBody] User[] usersToSave)
 {
     try
     {
         DBMethods.SaveGroup(usersToSave.ToList <User>(), context);
         return(Ok());
     }
     catch (Exception)
     {
         return(BadRequest());
     }
 }
Exemplo n.º 20
0
 public HttpResponseMessage Get()
 {
     try
     {
         DBMethods dBMethods            = new DBMethods();
         IEnumerable <VW_Person> person = dBMethods.GetPersonDetails();
         return(Request.CreateResponse(HttpStatusCode.OK, person));
     }
     catch (Exception e)
     {
         return(Request.CreateResponse(HttpStatusCode.BadRequest, "Error while retriving the Person detail list. Method(BergerPersonController.Get()) - " + e.Message));
     }
 }
Exemplo n.º 21
0
        public JsonResult Shorten([FromBody] RequestUrl obj)
        {
            if (obj.Url != null)
            {
                if (CheckUrl(obj.Url))
                {
                    string   hash;
                    DateTime start = DateTime.Today;
                    DateTime end   = DateTime.Today;
                    if (obj.AdvancedSettings?.Name == null)
                    {
                        do
                        {
                            hash = GetHashedUrl(obj.Url);
                        } while (DBMethods.CheckHash(hash));
                    }
                    else
                    {
                        hash = obj.AdvancedSettings.Name;
                    }

                    if (obj.AdvancedSettings?.StartDate != null)
                    {
                        start = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
                        start = start.AddMilliseconds(obj.AdvancedSettings.StartDate.Value).ToLocalTime();
                    }

                    if (obj.AdvancedSettings?.ExpireDate != null)
                    {
                        end = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
                        end = end.AddMilliseconds(obj.AdvancedSettings.ExpireDate.Value).ToLocalTime();
                    }
                    else
                    {
                        end = end.AddYears(5000);
                    }

                    DBMethods.CreateUrl(hash, obj.Url, start, end);

                    if (obj.AdvancedSettings != null && obj.AdvancedSettings.OnlyHash)
                    {
                        return(Json(new { url = hash }));
                    }
                    return(Json(new { url = _domain + hash }));
                }

                return(Json(new { err = "Url не валиден" }));
            }

            return(Json(new { err = "Не указан url" }));
        }
Exemplo n.º 22
0
        public ActionResult Index()
        {
            DBMethods     dbMethods = new DBMethods();
            SqlDataReader reader    = dbMethods.getReader("SELECT name FROM tbl_names WHERE id = 1");
            String        name      = "";

            while (reader.Read())
            {
                name = reader.GetString(0);
            }

            ViewBag.returnName = name;
            return(View());
        }
Exemplo n.º 23
0
 private void tsBill_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("You want to update this item?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         if (DBMethods.UpdatePurchaseStatusBilled(dgvStatsPurchase.Rows[dgvStatsPurchase.CurrentCell.RowIndex].Cells[1].Value.ToString(), "True"))
         {
             MessageBox.Show("Bill item Success!", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
             RefreshPurchaseView();
         }
         else
         {
             MessageBox.Show("Bill item Failed!", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         }
     }
 }
Exemplo n.º 24
0
        private void dgvListRequest_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex != -1)
            {
                if (dgvListRequest.CurrentCell.ColumnIndex == 4)
                {
                    if (dgvListRequest.Rows[dgvListRequest.CurrentCell.RowIndex].Cells[3].Value.ToString() == "")
                    {
                        if (MessageBox.Show("Approve Request?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            if (DBMethods.DashboardUpdateListRequest(dgvListRequest.Rows[dgvListRequest.CurrentCell.RowIndex].Cells[0].Value.ToString(), "Approved"))
                            {
                                MessageBox.Show("Success!", "", MessageBoxButtons.OK, MessageBoxIcon.Information);

                                //for Total Request Dashboard
                                DashboardRequest(DateTime.Now.AddMonths(datexx).ToString("MM"), DateTime.Now.AddMonths(datexx).ToString("yyyy"));
                                //for list request
                                DashboardListRequest();
                            }
                            else
                            {
                                MessageBox.Show("Failed!", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            }
                        }
                    }
                    else
                    {
                        if (MessageBox.Show("Re-open this item?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            if (DBMethods.DashboardUpdateListRequest(dgvListRequest.Rows[dgvListRequest.CurrentCell.RowIndex].Cells[0].Value.ToString(), ""))
                            {
                                MessageBox.Show("Success!", "", MessageBoxButtons.OK, MessageBoxIcon.Information);

                                //for Total Request Dashboard
                                DashboardRequest(DateTime.Now.AddMonths(datexx).ToString("MM"), DateTime.Now.AddMonths(datexx).ToString("yyyy"));
                                //for list request
                                DashboardListRequest();
                            }
                            else
                            {
                                MessageBox.Show("Failed!", "", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 25
0
        private void btnModifier_Click(object sender, RoutedEventArgs e)
        {
            Prop.ID_Pro        = Prop.ID_Pro;
            Prop.Titre         = textBoxTitre.Text;
            Prop.Prenom        = textBoxPrenom.Text;
            Prop.Nom_Pro       = textBoxNomProp.Text;
            Prop.Nom_p2        = textBoxNomp2.Text;
            Prop.NumRuePro     = textBoxNumRuePro.Text;
            Prop.TypeRuePro    = textBoxTypeRuePro.Text;
            Prop.RueProp       = textBoxRueProp.Text;
            Prop.CodePostalPro = textBoxCodePostalPro.Text;
            Prop.VillePro      = textBoxVillePro.Text;
            Prop.Tel           = textBoxTel.Text;
            Prop.TaxeFonc      = textBoxTaxeFonc.Text;
            DBMethods met = new DBMethods();

            met.modifProprioBD(Prop);
        }
Exemplo n.º 26
0
 public IActionResult RedirectTo(string hash)
 {
     if (DBMethods.CheckHash(hash))
     {
         Url      url = DBMethods.GetUrlByHash(hash);
         DateTime now = DateTime.Now;
         if (url.ExpirationDate <= now)
         {
             DBMethods.DeleteByHash(hash);
             return(View("Index"));
         }
         if (url.CreateDate <= now)
         {
             return(Redirect(url.Link));
         }
     }
     return(View("Index"));
 }
Exemplo n.º 27
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Save Supplier?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         if (DBMethods.InsertSupplierList(txtItem.Text, txtVendor.Text, txtAddress.Text, txtContactPerson.Text, txtContactNumber.Text, txtEmail.Text, txtTerms.Text, txtTIN.Text))
         {
             MessageBox.Show("Save Supplier Success!", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
             LoadData();
             txtItem.Text          = string.Empty;
             txtVendor.Text        = string.Empty;
             txtAddress.Text       = string.Empty;
             txtContactPerson.Text = string.Empty;
             txtContactNumber.Text = string.Empty;
             txtEmail.Text         = string.Empty;
             txtTerms.Text         = string.Empty;
             txtTIN.Text           = string.Empty;
         }
     }
 }
Exemplo n.º 28
0
        void DashboardListRequest()
        {
            DataTable Dtlist = new DataTable();

            Dtlist = DBMethods.DashboardListRequest();
            dgvListRequest.Rows.Clear();

            if (Dtlist.Rows.Count > 0)
            {
                for (int i = 0; i <= Dtlist.Rows.Count - 1; i++)
                {
                    dgvListRequest.Rows.Add(new object[] { Dtlist.Rows[i]["RPRID"].ToString(), Dtlist.Rows[i]["RPRNum"].ToString(),
                                                           Convert.ToDateTime(Dtlist.Rows[i]["RDate"]).ToString("MMM dd, yyyy"),
                                                           Dtlist.Rows[i]["RStatus"].ToString(), Dtlist.Rows[i]["RStatus"].ToString() == "" ? dashImage.Images[1] : dashImage.Images[0] });

                    Application.DoEvents();
                }
            }
        }
Exemplo n.º 29
0
        void SubRefresh()
        {
            DataTable DtUsers = new DataTable();

            DtUsers = DBMethods.GetUsersCredentialsList();
            dgvUsers.Rows.Clear();

            if (DtUsers.Rows.Count > 0)
            {
                for (int i = 0; i <= DtUsers.Rows.Count - 1; i++)
                {
                    dgvUsers.Rows.Add(new object[] { imageList1.Images[0], DtUsers.Rows[i]["ID"].ToString(), DtUsers.Rows[i]["Username"].ToString(),
                                                     DtUsers.Rows[i]["Password"].ToString(), DtUsers.Rows[i]["Email"].ToString(), DtUsers.Rows[i]["Active"].ToString(),
                                                     DtUsers.Rows[i]["Active"].ToString() == "True" ? imageList1.Images[3] : imageList1.Images[4], DtUsers.Rows[i]["Rights"].ToString(),
                                                     imageList1.Images[1], imageList1.Images[2] });

                    Application.DoEvents();
                }
            }
        }
Exemplo n.º 30
0
 public HttpResponseMessage Get(int id)
 {
     try
     {
         DBMethods dBMethods            = new DBMethods();
         IEnumerable <VW_Person> person = dBMethods.GetPersonDetails(id);
         if (person.First() == null)
         {
             return(Request.CreateResponse(HttpStatusCode.NotFound, "User Not found with the BusinessEntityID - " + id));
         }
         else
         {
             return(Request.CreateResponse(HttpStatusCode.OK, person));
         }
     }
     catch (Exception e)
     {
         return(Request.CreateResponse(HttpStatusCode.BadRequest, "Error while retriving the Person detail. Method(BergerPersonController.Get(BusinessEntityID)) - " + e.Message));
     }
 }