示例#1
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);
        }
示例#2
0
        public void SetAction(BtnEvent pAction, string pPkValue)
        {
            fAction = pAction;

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

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

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

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

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

            this.LoadData();
        }
示例#3
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);
            }
        }
示例#4
0
 void txt_state_LookupUpdate(object sender, EventArgs e)
 {
     txt_state_name.LookupList = CState_exten.GetforLookup(new DAL());
 }