Esempio n. 1
0
 private void LoadClientCount()
 {
     GarasERP.Client clients = new GarasERP.Client();
     clients.Where.SalesPersonID.Value = UserID;
     clients.Query.Load();
     lblClientCount.Text = clients.RowCount.ToString();
 }
Esempio n. 2
0
        //protected void lnkBtnEdit_Command(object sender, CommandEventArgs e)
        //{
        //    //if(lnkBtnEdit.CommandName == "Edit")
        //    //{
        //    //    //pnlClientInfo.Enabled = true;
        //    //    lnkBtnEdit.CommandName = "Cancel";
        //    //    lnkBtnEdit.Text = "Cancel";
        //    //}
        //    //else if(lnkBtnEdit.CommandName == "Cancel")
        //    //{
        //    //    //pnlClientInfo.Enabled = false;
        //    //    lnkBtnEdit.CommandName = "Edit";
        //    //    lnkBtnEdit.Text = "Edit";
        //    //}
        //}

        //protected void ShowBoxesBasedOnType(string myType)
        //{
        //    if (myType.Contains("Individual"))
        //    {
        //        rbIndividual.Checked = true;
        //        rbSmall.Checked = false;
        //        rbBig.Checked = false;
        //        rbCompanies.Checked = false;
        //    }
        //    else if (myType.Contains("Group")) {
        //        rbIndividual.Checked = false;
        //        rbSmall.Checked = false;
        //        rbBig.Checked = false;
        //        rbCompanies.Checked = true;
        //    }
        //    else if(myType.Contains("Small"))
        //    {
        //        rbIndividual.Checked = false;
        //        rbSmall.Checked = true;
        //        rbBig.Checked = false;
        //        rbCompanies.Checked = false;
        //    }
        //    else if(myType.Contains("Big"))
        //    {
        //        rbIndividual.Checked = false;
        //        rbSmall.Checked = false;
        //        rbBig.Checked = true;
        //        rbCompanies.Checked = false;
        //    }

        //}
        //protected void LoadNameBasedOnType()
        //{

        //    //if (rbBig.Checked == true)
        //    //{
        //    //    lblCompanyName.Visible = true;
        //    //    tbxCompanyName.Visible = true;

        //    //    lblBranch.Visible = true;
        //    //    tbxBranch.Visible = true;

        //    //    lblGroupName.Visible = false;
        //    //    tbxGroupName.Visible = false;

        //    //    //selectedRadio = rbBig.Text;
        //    //    //selectedName = tbxCompanyName.Text;
        //    //}

        //    //else if (rbCompanies.Checked == true)
        //    //{
        //    //    lblGroupName.Visible = true;
        //    //    tbxGroupName.Visible = true;

        //    //    lblCompanyName.Visible = true;
        //    //    tbxCompanyName.Visible = true;

        //    //    lblBranch.Visible = false;
        //    //    tbxBranch.Visible = false;

        //    //    //selectedRadio = rbCompanies.Text;
        //    //    //selectedName = tbxCompanyName.Text;
        //    //}
        //    //else if (rbSmall.Checked == true)
        //    //{
        //    //    lblCompanyName.Visible = true;
        //    //    tbxCompanyName.Visible = true;

        //    //    lblGroupName.Visible = false;
        //    //    tbxGroupName.Visible = false;

        //    //    lblBranch.Visible = false;
        //    //    tbxBranch.Visible = false;

        //    //    //selectedRadio = rbSmall.Text;
        //    //    //selectedName = tbxCompanyName.Text;
        //    //}
        //    //else if (rbIndividual.Checked == true)
        //    //{
        //    //    lblGroupName.Visible = true;
        //    //    tbxGroupName.Visible = true;

        //    //    lblCompanyName.Visible = false;
        //    //    tbxCompanyName.Visible = false;
        //    //    lblBranch.Visible = false;
        //    //    tbxBranch.Visible = false;

        //    //    //selectedRadio = rbIndividual.Text;
        //    //    //selectedName = tbxGroupName.Text;
        //    //}
        //    //else
        //    //{
        //    //    lblGroupName.Visible = false;
        //    //    tbxGroupName.Visible = false;
        //    //    lblCompanyName.Visible = false;
        //    //    tbxCompanyName.Visible = false;
        //    //    lblBranch.Visible = false;
        //    //    tbxBranch.Visible = false;

        //    //}
        //}

        protected void GetTextboxes(int ID)
        {
            GarasERP.Client client = new GarasERP.Client();
            client.Where.ID.Value = ID;
            client.Query.Load();
            GarasERP.ClientAddress clientAddress = new GarasERP.ClientAddress();
            clientAddress.Where.ClientID.Value = ID;
            clientAddress.Query.Load();
            GarasERP.ClientPhone clientPhone = new GarasERP.ClientPhone();
            clientPhone.Where.ClientID.Value = ID;
            clientPhone.Query.Load();
            GarasERP.ClientMobile clientMobile = new GarasERP.ClientMobile();
            clientMobile.Where.ClientID.Value = ID;
            clientMobile.Query.Load();

            GarasERP.ClientContactPerson contact = new GarasERP.ClientContactPerson();
            contact.Where.ClientID.Value = ID;
            contact.Query.Load();

            GarasERP.ClientConsultant consultant = new GarasERP.ClientConsultant();
            consultant.Where.ClientID.Value = ID;
            consultant.Query.Load();

            if (client.DefaultView != null && client.DefaultView.Count > 0)
            {
                //if (rbBig.Checked == true)
                //{
                //    tbxCompanyName.Text = client.Name;
                //    tbxBranch.Text = client.BranchName;
                //}
                //else if (rbSmall.Checked == true)
                //{
                //    tbxCompanyName.Text = client.Name;
                //}
                //else if (rbCompanies.Checked)
                //{
                //    tbxGroupName.Text = client.GroupName;
                //    tbxCompanyName.Text = client.Name;
                //}
                //else
                //    tbxCompanyName.Text = client.GroupName;

                //tbxEmail.Text = client.Email;
                //tbxWebsite.Text = client.WebSite;
                //ddlAssignedTo.SelectedValue = client.SalesPersonID.ToString();
                //ddlFollowUpPeriod.SelectedValue = client.FollowUpPeriod.ToString();
                //tbxNote.Text = client.Note;
            }

            //if(clientAddress.DefaultView != null && clientAddress.DefaultView.Count > 0)
            //{
            //    tbxStreet.Text = clientAddress.Address;
            //    tbxBuilding.Text = clientAddress.BuildingNumber;
            //    tbxFloor.Text = clientAddress.Floor;
            //    tbxDesc.Text = clientAddress.Description;
            //    ddlCountry.SelectedValue = clientAddress.CountryID.ToString();
            //    ddlGovernate.SelectedValue = clientAddress.GovernorateID.ToString();
            //}

            //if(clientPhone.DefaultView != null && clientPhone.DefaultView.Count > 0)
            //{
            //    tbxPhone.Text = clientPhone.Phone;
            //}

            //if(clientMobile.DefaultView != null && clientMobile.DefaultView.Count > 0)
            //{
            //    tbxMobile.Text = clientMobile.Mobile;
            //}
            //if(contact.DefaultView != null && contact.DefaultView.Count > 0)
            //{
            //    tbxContactName.Text = contact.Name;
            //    tbxContactEmail.Text = contact.Email;
            //    tbxContactLocation.Text = contact.Location;
            //    tbxContactMobile.Text = contact.Mobile;
            //    tbxContactTitle.Text = contact.Title;
            //}
            //if(consultant.DefaultView != null && consultant.DefaultView.Count >0)
            //{
            //    GarasERP.ClientConsultantAddress consultantAddress = new GarasERP.ClientConsultantAddress();
            //    consultantAddress.Where.ConsultantID.Value = consultant.ID;
            //    consultantAddress.Query.Load();

            //    tbxConsultantName.Text = consultant.ConsultantName;

            //    tbxConsultantBuilding.Text = consultantAddress.BuildingNumber;
            //    tbxConsultantFloor.Text = consultantAddress.Floor;
            //    tbxConsultantStreet.Text = consultantAddress.Address;
            //    tbxConsultantDescription.Text = consultantAddress.Description;
            //    ddlConsultantCountry.SelectedValue = consultantAddress.CountryID.ToString();
            //    ddlConsultantGovernorate.SelectedValue = consultantAddress.GovernorateID.ToString();
            //}
        }