Exemple #1
0
        private static bool CheckData(Company obj, string newDB)
        {
            string q = "USE " + newDB + "; ";

            q += "SELECT * FROM " + COMPANY.COMPANY_TBL + " WHERE " + COMPANY.COMPANY_ID + " = '" + company_id + "'; ";

            using (IDataReader redr = new DAL().Listreader(q))
            {
                while (redr.Read() == true)
                {
                    obj.Company_id   = redr[COMPANY.COMPANY_ID].ToString();
                    obj.Company_name = redr[COMPANY.COMPANY_NAME].ToString();
                    //obj.Display_name = redr[COMPANY.DISPLAY_NAME].ToString();
                    obj.City_id    = CCity_exten.GetId_Name(ChangeCase.UpperFirst(obj.City_id));
                    obj.State_id   = CState_exten.GetId_Name(ChangeCase.UpperFirst(obj.State_id));
                    obj.Country_id = CCountry_exten.GetId_Name(obj.Country_id.ToUpper());
                    obj.Pincode_id = CPincode_exten.GetId_Name(obj.Pincode_id.Replace(" ", string.Empty));

                    CCompany.Update(obj, new DAL());

                    return(true);
                }
                return(false);
            }
        }
Exemple #2
0
        private Company CollectData()
        {
            Company fobj = new Company()
            {
                Company_id   = vId,
                Company_name = txt_company_name.Text,
                Display_name = txt_display_name.Text.ToUpper(),
                Street1      = txt_street1.Text,
                Street2      = txt_street2.Text,
                City_id      = CCity_exten.GetId_Name(txt_city_id.Text),
                State_id     = CState_exten.GetId_Name(txt_state_id.Text),
                Country_id   = CCountry_exten.GetId_Name(txt_country_id.Text),
                Pincode_id   = CPincode_exten.GetId_Name(txt_pincode_id.Text),
                Cell1        = txt_cell1.Text,
                Cell2        = txt_cell2.Text,
                Phone        = txt_phone.Text,
                Email        = txt_email.Text,
                Website      = txt_website.Text,
                Gstin        = txt_gst.Text.ToUpper(),
                Pan          = txt_pan.Text,
                Active_id    = Core.Stative,
                Notes        = txt_notes.Text,
                Comp_code    = Current.Comp_code,
                User_id      = Current.User
            };

            return(fobj);
        }
Exemple #3
0
        public void List_Option(ListOption pAction)
        {
            fAction = pAction;

            switch (fAction)
            {
            case ListOption.active:

                if (chk_notactive.Checked == true)
                {
                    LoadData(CPincode_exten.NotActive(new DAL()));
                }
                else
                {
                    LoadData(CPincode_exten.Active(new DAL()));
                }

                break;

            case ListOption.notactive:

                if (chk_notactive.Checked == true)
                {
                    LoadData(CPincode_exten.NotActive(new DAL()));
                }
                else
                {
                    LoadData(CPincode_exten.Active(new DAL()));
                }

                break;

            case ListOption.Search:
                if (txt_pincode_name.Text != "")
                {
                    List <Pincode> list = new List <Pincode>
                    {
                        CPincode_exten.SearchName(txt_pincode_name.Text, new DAL())
                    };
                    LoadData(list);
                }
                else
                {
                    LoadData(CPincode_exten.Active(new DAL()));
                }
                break;

            default:
                LoadData(CPincode_exten.Active(new DAL()));
                break;
            }
        }
Exemple #4
0
 private static void InsertData(Party obj, string newDB)
 {
     if (CheckData(obj, newDB) == false)
     {
         obj.Party_name = obj.Party_name.ToUpper();
         obj.City_id    = CCity_exten.GetId_Name(ChangeCase.UpperFirst(obj.City_id));
         obj.State_id   = CState_exten.GetId_Name(ChangeCase.UpperFirst(obj.State_id));
         obj.Country_id = CCountry_exten.GetId_Name(obj.Country_id.ToUpper());
         obj.Pincode_id = CPincode_exten.GetId_Name(obj.Pincode_id.Replace(" ", string.Empty));
         CParty.Insert(obj, new DAL());
     }
     ;
 }
Exemple #5
0
        private Party CollectData()
        {
            Party fobj = new Party()
            {
                Party_id        = vId,
                Party_name      = ChangeCase.ToUpper(txt_party_name.Text),
                Contacttype_id  = CContacttype_exten.GetId_Name(txt_contacttype_id.Text),
                Contact_person  = ChangeCase.UpperFirst(txt_contact_person.Text),
                Street_1        = txt_street1.Text,
                Street_2        = txt_street2.Text,
                City_id         = CCity_exten.GetId_Name(txt_city_id.Text),
                State_id        = CState_exten.GetId_Name(txt_state_id.Text),
                Country_id      = CCountry_exten.GetId_Name(txt_country_id.Text),
                Pincode_id      = CPincode_exten.GetId_Name(txt_pincode_id.Text),
                Phone           = txt_phone.Text,
                Cell            = txt_cell.Text,
                Email           = txt_email.Text,
                Website         = txt_website.Text,
                Gstin           = ChangeCase.ToUpper(txt_gst.Text),
                Pan             = txt_pan.Text,
                Opening_balance = ConvertTO.Decimal(txt_opening_balance.Text),
                Credit_days     = ConvertTO.Decimal(txt_credit_days.Text),
                Active_id       = Core.Stative,
                Notes           = txt_notes.Text,
                User_id         = Current.User
            };

            if ((fobj.Contacttype_id == null) || (fobj.Contacttype_id == ""))
            {
                fobj.Contacttype_id = "1";
            }
            if ((fobj.City_id == null) || (fobj.City_id == ""))
            {
                fobj.City_id = "1";
            }
            if ((fobj.State_id == null) || (fobj.State_id == ""))
            {
                fobj.State_id = "1";
            }
            if ((fobj.Country_id == null) || (fobj.Country_id == ""))
            {
                fobj.Country_id = "1";
            }
            if ((fobj.Pincode_id == null) || (fobj.Pincode_id == ""))
            {
                fobj.Pincode_id = "1";
            }

            return(fobj);
        }
Exemple #6
0
        public void SetAction(BtnEvent pAction, string pPkValue)
        {
            fAction = pAction;

            switch (fAction)
            {
            case BtnEvent.Open:
                btn_save.Text = "&CLOSE";
                obj           = CPincode_exten.PKId(pPkValue, new DAL());
                this.EnableControls(false);
                break;

            case BtnEvent.New:
                btn_save.Text = "&SAVE";
                obj           = CPincode.GetNew;
                this.EnableControls(true);
                break;

            case BtnEvent.Edit:
                btn_save.Text = "&UPDATE";
                obj           = CPincode_exten.PKId(pPkValue, new DAL());
                this.EnableControls(true);
                break;

            case BtnEvent.Delete:
                btn_save.Text = "CONFIRM\r\n&DELETE";
                obj           = CPincode_exten.PKId(pPkValue, new DAL());
                this.EnableControls(false);
                break;

            case BtnEvent.Print:
                btn_save.Text = "&PRINT";
                obj           = CPincode_exten.PKId(pPkValue, new DAL());
                this.EnableControls(false);
                break;
            }

            this.LoadData();
        }
Exemple #7
0
        private static bool CheckData(Party obj, string newDB)
        {
            string q = "USE " + newDB + "; ";

            q += "SELECT * FROM " + PARTY.PARTY_TBL + " WHERE " + PARTY.PARTY_NAME + " = '" + obj.Party_name + "'; ";

            using (IDataReader redr = new DAL().Listreader(q))
            {
                while (redr.Read() == true)
                {
                    obj.Party_id   = redr[PARTY.PARTY_ID].ToString();
                    obj.Party_name = obj.Party_name.ToUpper();
                    obj.City_id    = CCity_exten.GetId_Name(ChangeCase.UpperFirst(obj.City_id));
                    obj.State_id   = CState_exten.GetId_Name(ChangeCase.UpperFirst(obj.State_id));
                    obj.Country_id = CCountry_exten.GetId_Name(obj.Country_id.ToUpper());
                    obj.Pincode_id = CPincode_exten.GetId_Name(obj.Pincode_id.Replace(" ", string.Empty));

                    CParty.Update(obj, new DAL());

                    return(true);
                }
                return(false);
            }
        }
Exemple #8
0
 void txt_pincode_LookupUpdate(object sender, EventArgs e)
 {
     txt_pincode_id.LookupList = CPincode_exten.GetforLookup(new DAL());
 }