Ejemplo n.º 1
0
        public static int Insertion_LicenseLookup(int licid, string lictype, string licformat, string linkedlictype, string Exptype, string NumberforExp, string ExpDay, string ExpMonth, string Renewalstartday, string Renewalstartmonth, string RenewalEndDay, string RenewalEndMonth, string LicFee, string RenewalFee, string ReinstateFee, string LateRenewalFee, string isparentMust)
        {
            using (AdminLinq.AdminDataContext pdetalinsert = new   AdminLinq.AdminDataContext())
            {
                tbl_lkp_License LicData;
                if (licid == 0)
                {
                    LicData = new tbl_lkp_License();
                }
                else
                {
                    LicData = pdetalinsert.tbl_lkp_Licenses.Where(c => c.LicenseType_ID == licid).SingleOrDefault();
                }

                LicData.LicenseType_ID      = licid;
                LicData.License_Type        = lictype;
                LicData.License_Format      = licformat;
                LicData.Linked_LicenseType  = linkedlictype;
                LicData.ExpType             = Exptype;
                LicData.Numberfor_Exp       = NumberforExp;
                LicData.Exp_Day             = ExpDay;
                LicData.Exp_Month           = ExpMonth;
                LicData.Renewal_Start_Day   = Renewalstartday;
                LicData.Renewal_Start_Month = Renewalstartmonth;
                LicData.Renewal_End_Day     = RenewalEndDay;
                LicData.Renewal_End_Month   = RenewalEndMonth;
                LicData.License_Fee         = LicFee;
                LicData.Renewal_Fee         = RenewalFee;
                LicData.Reinstate_Fee       = ReinstateFee;
                LicData.Late_Renewal_Fee    = LateRenewalFee;
                LicData.Is_ParentLicmust    = isparentMust;


                if (licid == 0)
                {
                    pdetalinsert.tbl_lkp_Licenses.InsertOnSubmit(LicData);
                }
                pdetalinsert.SubmitChanges();
                return(LicData.LicenseType_ID);
            }
        }
Ejemplo n.º 2
0
        protected void btnedit_click(object sender, EventArgs e)
        {
            string          value = hfdselid.Value;
            tbl_lkp_License obj   = adminUtilities.Edit_LicenseLookup(Convert.ToInt32(value));

            hfdlic.Value            = obj.LicenseType_ID.ToString();
            txtlictype.Text         = obj.License_Type;
            txt_licformat.Text      = obj.License_Format;
            txt_noforexpiry.Text    = obj.Numberfor_Exp;
            txt_renewalfee.Text     = obj.Renewal_Fee;
            txt_licfee.Text         = obj.License_Fee;
            txt_laterenewalfee.Text = obj.Late_Renewal_Fee;
            txt_reinstatefee.Text   = obj.Reinstate_Fee;
            string lkdlic = obj.Linked_LicenseType;

            if (ddl_linkedlictype.Items[0].Text != lkdlic)
            {
                ddl_linkedlictype.Items[0].Selected = false;
                if (ddl_linkedlictype.Items.FindByText(lkdlic) != null)
                {
                    ddl_linkedlictype.Items.FindByText(lkdlic).Selected = true;
                }
            }
            string exptype = obj.ExpType;

            if (ddl_Exptype.Items[0].Text != exptype)
            {
                ddl_Exptype.Items[0].Selected = false;
                if (ddl_Exptype.Items.FindByText(exptype) != null)
                {
                    ddl_Exptype.Items.FindByText(exptype).Selected = true;
                }
            }
            string expday = obj.Exp_Day;

            if (ddl_expday.Items[0].Text != expday)
            {
                ddl_expday.Items[0].Selected = false;
                if (ddl_expday.Items.FindByText(expday) != null)
                {
                    ddl_expday.Items.FindByText(expday).Selected = true;
                }
            }
            string expmonth = obj.Exp_Month;

            if (ddl_expmonth.Items[0].Text != expmonth)
            {
                ddl_expmonth.Items[0].Selected = false;
                if (ddl_expmonth.Items.FindByText(expmonth) != null)
                {
                    ddl_expmonth.Items.FindByText(expmonth).Selected = true;
                }
            }
            string restartday = obj.Renewal_Start_Day;

            if (ddlrenewalstartday.Items[0].Text != restartday)
            {
                ddlrenewalstartday.Items[0].Selected = false;
                if (ddlrenewalstartday.Items.FindByText(restartday) != null)
                {
                    ddlrenewalstartday.Items.FindByText(restartday).Selected = true;
                }
            }
            string restartmonth = obj.Renewal_Start_Month;

            if (ddlrenewalstartmonth.Items[0].Text != restartmonth)
            {
                ddlrenewalstartmonth.Items[0].Selected = false;
                if (ddlrenewalstartmonth.Items.FindByText(restartmonth) != null)
                {
                    ddlrenewalstartmonth.Items.FindByText(restartmonth).Selected = true;
                }
            }
            string reendday = obj.Renewal_End_Day;

            if (ddlrenewalendday.Items[0].Text != reendday)
            {
                ddlrenewalendday.Items[0].Selected = false;
                if (ddlrenewalendday.Items.FindByText(reendday) != null)
                {
                    ddlrenewalendday.Items.FindByText(reendday).Selected = true;
                }
            }
            string reendmonth = obj.Renewal_End_Month;

            if (ddlrenewalendmonth.Items[0].Text != reendmonth)
            {
                ddlrenewalendmonth.Items[0].Selected = false;
                if (ddlrenewalendmonth.Items.FindByText(reendmonth) != null)
                {
                    ddlrenewalendmonth.Items.FindByText(reendmonth).Selected = true;
                }
            }
            string isparent = obj.Is_ParentLicmust;

            if (isparent == "True")
            {
                chk_parentidmust.Checked = true;
            }
            else
            {
                chk_parentidmust.Checked = false;
            }
        }