예제 #1
0
        public async Task <ActionResult> Create([Bind(Include = "mtypeId,MemType")] MemberType memberType)
        {
            if (ModelState.IsValid)
            {
                db.MemberTypes.Add(memberType);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(memberType));
        }
예제 #2
0
        public async Task <ActionResult> Create([Bind(Include = "AreaId,Area_Name")] Area area)
        {
            if (ModelState.IsValid)
            {
                db.Area.Add(area);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(area));
        }
예제 #3
0
        public async Task <ActionResult> Create([Bind(Include = "orgId,OrgType")] OrganizationType organizationType)
        {
            if (ModelState.IsValid)
            {
                db.OrganizationTypes.Add(organizationType);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(organizationType));
        }
예제 #4
0
        public async Task <ActionResult> Edit([Bind(Include = "BillID,BillDate,memberId,Remarks,paid")] BillRegister billRegister)
        {
            if (ModelState.IsValid)
            {
                db.Entry(billRegister).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.memberId = new SelectList(db.MemberCompanyInfo, "memberId", "Organization_Name", billRegister.memberId);
            return(View(billRegister));
        }
예제 #5
0
        public async Task <ActionResult> Create([Bind(Include = "HeaderId,HeaderName,HeaderType")] Header header)
        {
            if (ModelState.IsValid)
            {
                db.Headers.Add(header);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(header));
        }
예제 #6
0
        public async Task <ActionResult> Create([Bind(Include = "btypeid,btype")] BusinessType businessType)
        {
            if (ModelState.IsValid)
            {
                db.BusinessType.Add(businessType);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(businessType));
        }
예제 #7
0
        public async Task <ActionResult> Create([Bind(Include = "mbillsetupid,HeaderId,Amount")] MonthlyBillSetUP monthlyBillSetUP)
        {
            if (ModelState.IsValid)
            {
                db.MonthlyBillSetUPs.Add(monthlyBillSetUP);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.HeaderId = new SelectList(db.Headers, "HeaderId", "HeaderName", monthlyBillSetUP.HeaderId);
            return(View(monthlyBillSetUP));
        }
예제 #8
0
        public async Task <ActionResult> Edit([Bind(Include = "rid,rDate,memberId,Remarks,billId")] RecieveMaster recieveMaster, FormCollection form)
        {
            if (ModelState.IsValid)
            {
                string obillid = form["obillid"].ToString();
                if (!String.IsNullOrEmpty(obillid))
                {
                    string[] obill = obillid.Split(',');
                    foreach (var obi in obill)
                    {
                        int bi     = Convert.ToInt32(obi);
                        var billid = db.BillRegisters.Find(bi);
                        if (billid != null)

                        {
                            billid.paid = "N";
                            db.SaveChanges();
                        }
                    }
                }
                string bllid = form["billId"].ToString();
                if (!String.IsNullOrEmpty(bllid))
                {
                    string[] oill = bllid.Split(',');
                    foreach (var obi in oill)
                    {
                        int bi    = Convert.ToInt32(obi);
                        var billd = db.BillRegisters.Find(bi);
                        if (billd != null)

                        {
                            billd.paid = "Y";
                            db.SaveChanges();
                        }
                    }
                }
                recieveMaster.billId = bllid.ToString();

                db.Entry(recieveMaster).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.memberId = new SelectList(db.MemberCompanyInfo, "memberId", "Organization_Name", recieveMaster.memberId);
            return(View(recieveMaster));
        }
예제 #9
0
        public async Task <ActionResult> Create([Bind(Include = "mid,memberId,membershipDate,Organization_Name,Organization_Address,Phone,Trade_License,Tin_Number,AreaId,btypeid,orgId,mtypeId,InCorporationDate,isVoter,status,Applicant_Name,Designation,Father_Name,Mother_Name,Present_address,Permanent_Address,National_Id,Mobile_No,Tin_No")] MemberCompanyInfo memberCompanyInfo, HttpPostedFileBase file, FormCollection frm)
        {
            if (ModelState.IsValid)
            {
                db.MemberCompanyInfo.Add(memberCompanyInfo);
                await db.SaveChangesAsync();

                if (file != null)
                {
                    string pic  = System.IO.Path.GetFileName(file.FileName);
                    string path = System.IO.Path.Combine(
                        Server.MapPath("~/MemberImg/"), memberCompanyInfo.mid.ToString() + ".jpg");
                    //memberCompanyInfo.photo_path = path;
                    // file is uploaded
                    file.SaveAs(path);

                    // save the image path path to the database or you can send image
                    // directly to database
                    // in-case if you want to store byte[] ie. for DB
                }
                string int_mid = frm["int_mid"].ToString();
                if (!string.IsNullOrEmpty(int_mid))
                {
                    Introducer intd = new Introducer();
                    intd.REFID    = memberCompanyInfo.mid;
                    intd.MEMBERID = int_mid;
                    db.Introducer.Add(intd);
                    db.SaveChanges();
                }
                //return RedirectToAction("Index");
            }

            ViewBag.AreaId  = new SelectList(db.Area, "AreaId", "Area_Name", memberCompanyInfo.AreaId);
            ViewBag.btypeid = new SelectList(db.BusinessType, "btypeid", "btype", memberCompanyInfo.btypeid);
            return(View(memberCompanyInfo));
        }