public CreateInvoice GetInvoice(string companyid, string customerid)
 {
     CreateInvoice cr = new CreateInvoice();
     cr.companyid = companyid;
     cr.templateid = ProfileModel.GetDefaultTemplate(companyid);
     cr.IsCustomerChoosen = true;
     cr.customerid = customerid;
     return cr;
 }
        public CreateInvoice GetInvoice(string companyid, string customerid)
        {
            CreateInvoice cr = new CreateInvoice();

            cr.companyid         = companyid;
            cr.templateid        = ProfileModel.GetDefaultTemplate(companyid);
            cr.IsCustomerChoosen = true;
            cr.customerid        = customerid;
            return(cr);
        }
        public ActionResult Create()
        {
            string customerid = "";
            if (!String.IsNullOrEmpty(Request.QueryString["cid"]))
                customerid = Request.QueryString["cid"].ToString();

            CreateInvoice crinv = new CreateInvoice();
            if (customerid != "")
            {
                crinv = new CreateInvoice().GetInvoice(Session["companyid"].ToString(), customerid);
                crinv.templatedata = GetInvoiceTemplate(crinv.templateid);
                return View(crinv);
            }
            else
            {
                crinv = new CreateInvoice().GetInvoice(Session["companyid"].ToString());
                crinv.templatedata = GetInvoiceTemplate(crinv.templateid);
                return View(crinv);
            }
        }