public PartyMaster GetPartyMasterDetails(String partyID)
        {
            PartyMaster obj = null;

            string commandText = OleDBHelper.GetQueryText("PartyMaster_SelectID", QueryType.Procedures);

            OleDbParameter[] parameters = new OleDbParameter[]
            {
                new OleDbParameter("@PartyID", partyID)
            };

            using (DataTable table = OleDBHelper.ExecuteParamerizedSelectCommand(commandText, CommandType.Text, parameters))
            {
                //check if any record exist or not
                if (table.Rows.Count > 0)
                {
                    //Lets go ahead and create the list of employees
                    obj = new PartyMaster();

                    obj.PartyID      = Convert.ToString(table.Rows[0]["PartyID"]);
                    obj.PartyName    = Convert.ToString(table.Rows[0]["PartyName"]);
                    obj.PersonName   = Convert.ToString(table.Rows[0]["PersonName"]);
                    obj.Address      = Convert.ToString(table.Rows[0]["Address"]);
                    obj.ContactNo    = Convert.ToString(table.Rows[0]["ContactNo"]);
                    obj.Mobile       = Convert.ToString(table.Rows[0]["Mobile"]);
                    obj.EamilAddress = Convert.ToString(table.Rows[0]["EamilAddress"]);
                    obj.Remarks      = Convert.ToString(table.Rows[0]["Remarks"]);
                }
            }

            return(obj);
        }
        private void ProcessPartyMasterLookupInterface()
        {
            PartyMaster selectedParty = new PartyMaster();

            frmPartyMasterLookup objLookup = new frmPartyMasterLookup();

            DialogResult result;

            result = objLookup.ShowDialog();
            if (result == DialogResult.OK)
            {
                selectedParty = objLookup.PartyMasterSelected;
                if (selectedParty != null)
                {
                    _partyMaster = selectedParty;
                }


                FillParty(_partyMaster);
            }
            else
            {
                selectedParty = null;
            }

            objLookup.Close();
            objLookup = null;
        }
Beispiel #3
0
        private void FillListView()
        {
            List <PartyMaster> list    = new List <PartyMaster>();
            PartyMaster        handler = new PartyMaster();

            list = handler.GetPartyMasterList();
            ListViewItem lvi = new ListViewItem();

            if (list != null)
            {
                if (list.Count > 0)
                {
                    foreach (PartyMaster obj in list)
                    {
                        lvi = new ListViewItem(obj.PartyID);
                        lvi.SubItems.Add(obj.PartyName);
                        lvi.SubItems.Add(obj.PersonName);
                        lvi.SubItems.Add(obj.Address);
                        lvi.SubItems.Add(obj.Remarks);
                        lvi.SubItems.Add(obj.ContactNo);
                        lvi.SubItems.Add(obj.Mobile);
                        lvi.SubItems.Add(obj.EamilAddress);
                        lvi.SubItems.Add(obj.Remarks);
                        listView1.Items.Add(lvi);
                    }
                }
            }
        }
        public ActionResult PersonalDetails(PartyMaster umodel)
        {
            string dob = umodel.DOB.Day + "/" + umodel.DOB.Month + "/" + umodel.DOB.Year;

            IDbDataParameter[] Insertparam = new[]
            {
                CreateParameter(DbType.String, 100, "@MemberName", ParameterDirection.Input, (umodel.MemberName)),
                CreateParameter(DbType.String, 4, "@CareOfName", ParameterDirection.Input, (umodel.CareOfName)),
                CreateParameter(DbType.String, 10, "@Sex", ParameterDirection.Input, (umodel.Sex)),
                CreateParameter(DbType.String, 50, "@DOB", ParameterDirection.Input, dob),
                CreateParameter(DbType.String, 500, "@Address", ParameterDirection.Input, (umodel.Address)),
                CreateParameter(DbType.String, 50, "@City", ParameterDirection.Input, (umodel.City)),
                CreateParameter(DbType.String, 50, "@State", ParameterDirection.Input, (umodel.State)),
                CreateParameter(DbType.String, 50, "@PinCode", ParameterDirection.Input, (umodel.PinCode)),
                CreateParameter(DbType.String, 100, "@Phones", ParameterDirection.Input, (umodel.Phones)),
                CreateParameter(DbType.String, 50, "@Mobile", ParameterDirection.Input, (umodel.Mobile)),
                CreateParameter(DbType.String, 50, "@Email", ParameterDirection.Input, (umodel.Email)),
                CreateParameter(DbType.String, 50, "@MemberId", ParameterDirection.Input, (umodel.MemberId))
            };
            var cmd = "Update PartyMaster set MemberName='@MemberName',CareOfName='@CareOfName',Sex='@Sex',DOB=convert(datetime,'@DOB',103),Address='@Address',City='@City',State='@State',PinCode=@PinCode,Phones='@Phones',Mobile='@Mobile',Email='@Email' where MemberId='@MemberId'";

            fetchdata.ExecuteQuery(cmd, Insertparam, CommandType.Text);
            ViewBag._DisplayMsg = "Personal Details Updated";
            // var model = GetProfileById(umodel.MemberId);
            return(View(umodel));
        }
        public ActionResult Index(PartyMaster model)
        {
            var usr = GetMyProfile();

            if (Request.Files.Count > 0)
            {
                if (Request.Files["UploadFile"] != null)
                {
                    HttpPostedFileBase file = Request.Files["UploadFile"];
                    if (file.ContentLength > 0)
                    {
                        string value = ConfigurationManager.AppSettings["SliderPath"];
                        usr.Photo = Common.UploadImage(value, file, "pic_");
                    }
                }


                IDbDataParameter[] Insertparam = new[]
                {
                    CreateParameter(DbType.String, 2000, "@Photo", ParameterDirection.Input, usr.Photo),
                    CreateParameter(DbType.String, 50, "@Msrno", ParameterDirection.Input, gMSRNO),
                };
                var cmd = "Update PartyMaster set Photo=@Photo where Msrno=@Msrno";
                fetchdata.ExecuteQuery(cmd, Insertparam, CommandType.Text);

                gPic = usr.Photo;
                return(RedirectToAction("Index"));
            }


            return(View(model));
        }
Beispiel #6
0
        public ActionResult Register(string id = "")
        {
            PartyMaster model = new PartyMaster();

            model.SponsorId = id;
            return(View(model));
        }
        public void DisplayData(string itemID = "-1")
        {
            try
            {
                if (itemID == "-1")
                {
                    //New Item
                    //Get Item code
                    txtPartyID.Text = GlobalFunction.GetUniqueCode("PartyMaster");
                }
                else
                {
                    //Existing Item
                    PartyMaster objHandler = new PartyMaster();
                    PartyMaster obj        = objHandler.GetPartyMasterDetails(itemID);
                    if (obj != null)
                    {
                        ClearControl();
                        SetItem(obj);
                    }
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(System.Reflection.MethodBase.GetCurrentMethod().Name + "\n" + ex.Message);
            }
        }
Beispiel #8
0
        public PartyModel getPartyById(int id)
        {
            Mapper.CreateMap <PartyMaster, PartyModel>();
            PartyMaster objComp  = Dbcontext.PartyMasters.SingleOrDefault(m => m.PID == id);
            PartyModel  objCItem = Mapper.Map <PartyModel>(objComp);

            return(objCItem);
        }
Beispiel #9
0
        public ActionResult AssignPin(int id, string q)
        {
            PartyMaster model = new PartyMaster();

            ViewBag.PinId   = id;
            ViewBag.ETicket = q;
            return(View(model));
        }
Beispiel #10
0
        public PartyMaster CreatepartyMaster(PartyMaster _objCreate)
        {
            try
            {
                if (_objCreate != null)
                {
                    //Check Duplicate

                    using (LocalEntity _context = new LocalEntity())
                    {
                        var party    = _context.tblPartyMasters.OrderByDescending(x => x.PartyId).FirstOrDefault();
                        int intMaxId = 1;
                        if (party != null)
                        {
                            intMaxId = party.PartyId + 1;
                        }
                        string strPartyCode = "Party00" + intMaxId;

                        _context.tblPartyMasters.Add(new tblPartyMaster
                        {
                            PartyId       = intMaxId,
                            PartyCode     = strPartyCode,
                            ContactPerson = _objCreate.ContactPerson,
                            Address       = _objCreate.Address,
                            Phone         = _objCreate.Phone,
                            Mobile        = _objCreate.Mobile,
                            Fax           = _objCreate.Fax,
                            Email         = _objCreate.Email,
                            Pager         = _objCreate.Pager,
                            PartyName     = _objCreate.PartyName,
                            IsActive      = _objCreate.IsActive,
                            CreatedBy     = "System",
                            CreatedOn     = DateTime.Now
                        });
                        if (_context.SaveChanges() == 1)
                        {
                            _objCreate.Code        = Models.MessageCode.Success;
                            _objCreate.MessageText = _objCreate.PartyName + " has been created successfully.";
                        }
                        else
                        {
                            _objCreate.Code        = Models.MessageCode.Error;
                            _objCreate.MessageText = "Not Created. Pleases contact administor !!";
                        }
                    }
                }
            }
            catch (DbEntityValidationException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(_objCreate);
        }
Beispiel #11
0
        public int Update(PartyModel model)
        {
            Mapper.CreateMap <PartyModel, PartyMaster>();
            PartyMaster objVehicle = DbContext.PartyMasters.SingleOrDefault(m => m.PID == model.PID);

            objVehicle = Mapper.Map(model, objVehicle);
            DbContext.SaveChanges();
            return(DbContext.SaveChanges());
        }
Beispiel #12
0
        /*Party Master : start*/
        public PartyMaster SavePartyMaster(PartyMaster partymaster)
        {
            SqlParameter[] parameter;

            parameter     = new SqlParameter[40];
            parameter[0]  = new SqlParameter("@Type", partymaster.Type);
            parameter[1]  = new SqlParameter("@Name", partymaster.Name);
            parameter[2]  = new SqlParameter("@Address1", partymaster.Address1);
            parameter[3]  = new SqlParameter("@Address2", partymaster.Address2);
            parameter[4]  = new SqlParameter("@Address3", partymaster.Address3);
            parameter[5]  = new SqlParameter("@City", partymaster.City);
            parameter[6]  = new SqlParameter("@Pincode", partymaster.Pincode);
            parameter[7]  = new SqlParameter("@State", partymaster.State);
            parameter[8]  = new SqlParameter("@Country", partymaster.Country);
            parameter[9]  = new SqlParameter("@Peraddress1", partymaster.Peraddress1);
            parameter[10] = new SqlParameter("@Peraddress2", partymaster.Peraddress2);
            parameter[11] = new SqlParameter("@Peraddress3 ", partymaster.Peraddress3);
            parameter[12] = new SqlParameter("@Percity", partymaster.Percity);
            parameter[13] = new SqlParameter("@Perpincode", partymaster.Perpincode);
            parameter[14] = new SqlParameter("@Perstate", partymaster.Perstate);
            parameter[15] = new SqlParameter("@Percountry", partymaster.Percountry);
            parameter[16] = new SqlParameter("@Nationality", partymaster.Nationality);
            parameter[17] = new SqlParameter("@Residency", partymaster.Residency);
            parameter[18] = new SqlParameter("@Contactperson1", partymaster.Contactperson1);
            parameter[19] = new SqlParameter("@Tel1", partymaster.Tel1);
            parameter[20] = new SqlParameter("@Email1", partymaster.Email1);
            parameter[21] = new SqlParameter("@Contactperson2", partymaster.Contactperson2);
            parameter[22] = new SqlParameter("@Tel2", partymaster.Tel2);
            parameter[23] = new SqlParameter("@Email2", partymaster.Email2);
            parameter[24] = new SqlParameter("@Primaryid", partymaster.Primaryid);
            parameter[25] = new SqlParameter("@Panno", partymaster.Panno);
            parameter[26] = new SqlParameter("@Aadharno", partymaster.Aadharno);
            parameter[27] = new SqlParameter("@Gst", partymaster.Gst);
            parameter[28] = new SqlParameter("@Mobile", partymaster.Mobile);
            parameter[29] = new SqlParameter("@OpeningBalance", partymaster.OpeningBalance);
            parameter[30] = new SqlParameter("@BalancePost", partymaster.BalancePost);
            parameter[31] = new SqlParameter("@AddressInBill", partymaster.AddressInBill);
            parameter[32] = new SqlParameter("@Lock", partymaster.Lock);
            parameter[33] = new SqlParameter("@Category", partymaster.Category);
            parameter[34] = new SqlParameter("@Broker", partymaster.Broker);
            parameter[35] = new SqlParameter("@Location", partymaster.Location);
            parameter[36] = new SqlParameter("@CollectGST", partymaster.CollectGST);
            parameter[37] = new SqlParameter("@RBILICNo", partymaster.RBILICNo);
            parameter[38] = new SqlParameter("@RBIExp", partymaster.RBIExp);
            parameter[39] = new SqlParameter("@ControlAC", partymaster.ControlAC);


            DataSet dataSet = dataInterfaceSQL.GetDataSet("spInsertpartymaster", parameter, false, true);

            if (dataSet.Tables.Count > 0 && dataSet.Tables[0].Rows.Count > 0)
            {
                partymaster.Id = Convert.ToInt32(dataSet.Tables[0].Rows[0]["Id"]);
            }
            return(partymaster);
        }
 private void SetItem(PartyMaster obj)
 {
     txtPartyID.Text    = obj.PartyID;
     txtPartyName.Text  = obj.PartyName;
     txtPersonName.Text = obj.PersonName;
     txtAddress.Text    = obj.Address;
     txtContactNo.Text  = obj.ContactNo;
     txtMobile.Text     = obj.Mobile;
     txtEmail.Text      = obj.EamilAddress;
     txtRemarks.Text    = obj.Remarks;
 }
        public ActionResult PersonalDetails(string id = "")
        {
            if (gRole == "USER")
            {
                id = gMemberId;
            }
            var model = new PartyMaster();

            model = GetProfileById(id);
            return(View(model));
        }
        private void cmdPartyLookup_Click(object sender, EventArgs e)
        {
            PartyMaster partyMaster = (PartyMaster)GlobalFunction.ShowLookUpForm("frmPartyMaster");

            if (partyMaster != null)
            {
                PartyID           = partyMaster.PartyID;
                txtPartyName.Text = partyMaster.PartyName;
                txtContactNo.Text = partyMaster.ContactNo;
                txtAddress.Text   = partyMaster.Address;
            }
        }
Beispiel #16
0
        public ActionResult Register(PartyMaster model)
        {
            if (!CheckSponserId(model.SponsorId))
            {
                ViewBag.DisplayClass = "text-red";
                ViewBag._DisplayMsg  = "Please enter a valid SponsorId";
                return(View(model));
            }
            // IDbDataParameter[] param = new[]
            //{
            //   CreateParameter(DbType.String, 50, "@PanNo", ParameterDirection.InputOutput,model.PanNo),

            // };
            // string cmd = "Select * from PartyMaster where PanNo=@PanNo";
            // ds = fetchdata.GetDataSet(cmd, param, CommandType.Text);
            // if (ds.Tables.Count > 0)
            // {
            //     var dt = ds.Tables[0];

            //     var PartyMasterlist = CommonMethod.ConvertToList<PartyMaster>(dt).FirstOrDefault();
            //     if (PartyMasterlist == null)
            //     {
            var UnigueUrl = Guid.NewGuid().ToString().Replace("-", "");
            var OTP       = CreateEPin(7);

            IDbDataParameter[] Insertparam = new[]
            {
                CreateParameter(DbType.String, 50, "@SponsorId", ParameterDirection.Input, model.SponsorId),
                CreateParameter(DbType.String, 100, "@SponsorName", ParameterDirection.Input, model.SponsorName),
                CreateParameter(DbType.String, 100, "@MemberName", ParameterDirection.Input, model.MemberName),
                CreateParameter(DbType.String, 10, "@Sex", ParameterDirection.Input, model.Sex),
                CreateParameter(DbType.String, 50, "@PanNo", ParameterDirection.Input, ""),
                CreateParameter(DbType.String, 50, "@Mobile", ParameterDirection.Input, model.Mobile),
                CreateParameter(DbType.String, 50, "@Email", ParameterDirection.Input, model.Email),
                CreateParameter(DbType.String, 50, "@Password", ParameterDirection.Input, model.Password),
                CreateParameter(DbType.String, 500, "@UnigueUrl", ParameterDirection.Input, UnigueUrl),
                CreateParameter(DbType.String, 50, "@OTP", ParameterDirection.Input, OTP),
                CreateParameter(DbType.String, 50, "@OUTMemberID", ParameterDirection.Output, ""),
            };
            string cmd      = "spInsertMember";
            var    memberid = fetchdata.ExecuteQuerySP(cmd, Insertparam, CommandType.StoredProcedure);
            var    name     = model.MemberName + " Your MemberId is " + memberid;

            //SendOTP(model.Mobile, OTP,name);
            SendWelcomeMsg(model.Mobile, model.MemberName, memberid, model.Password);
            //return RedirectToAction("VerifyMobile",new {id= memberid });
            //    }
            //}
            ViewBag.DisplayClass = "text-green";
            ViewBag._DisplayMsg  = "Your account has been created. You can login to your account Now.";
            model = new PartyMaster();
            return(View(model));
        }
Beispiel #17
0
 public bool UpdateParty(PartyMaster partyMaster)
 {
     try
     {
         _context.Update(partyMaster);
         _context.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Beispiel #18
0
        public int UpdatePartyMaster(PartyMaster partymaster)
        {
            SqlParameter[] parameter = new SqlParameter[42];
            parameter[0]  = new SqlParameter("@Type", partymaster.Type);
            parameter[1]  = new SqlParameter("@Name", partymaster.Name);
            parameter[2]  = new SqlParameter("@Address1", partymaster.Address1);
            parameter[3]  = new SqlParameter("@Address2", partymaster.Address2);
            parameter[4]  = new SqlParameter("@Address3", partymaster.Address3);
            parameter[5]  = new SqlParameter("@City", partymaster.City);
            parameter[6]  = new SqlParameter("@Pincode", partymaster.Pincode);
            parameter[7]  = new SqlParameter("@State", partymaster.State);
            parameter[8]  = new SqlParameter("@Country", partymaster.Country);
            parameter[9]  = new SqlParameter("@Peraddress1", partymaster.Peraddress1);
            parameter[10] = new SqlParameter("@Peraddress2", partymaster.Peraddress2);
            parameter[11] = new SqlParameter("@Peraddress3 ", partymaster.Peraddress3);
            parameter[12] = new SqlParameter("@Percity", partymaster.Percity);
            parameter[13] = new SqlParameter("@Perpincode", partymaster.Perpincode);
            parameter[14] = new SqlParameter("@Perstate", partymaster.Perstate);
            parameter[15] = new SqlParameter("@Percountry", partymaster.Percountry);
            parameter[16] = new SqlParameter("@Nationality", partymaster.Nationality);
            parameter[17] = new SqlParameter("@Residency", partymaster.Residency);
            parameter[18] = new SqlParameter("@Contactperson1", partymaster.Contactperson1);
            parameter[19] = new SqlParameter("@Tel1", partymaster.Tel1);
            parameter[20] = new SqlParameter("@Email1", partymaster.Email1);
            parameter[21] = new SqlParameter("@Contactperson2", partymaster.Contactperson2);
            parameter[22] = new SqlParameter("@Tel2", partymaster.Tel2);
            parameter[23] = new SqlParameter("@Email2", partymaster.Email2);
            parameter[24] = new SqlParameter("@Primaryid", partymaster.Primaryid);
            parameter[25] = new SqlParameter("@Panno", partymaster.Panno);
            parameter[26] = new SqlParameter("@Aadharno", partymaster.Aadharno);
            parameter[27] = new SqlParameter("@Gst", partymaster.Gst);
            parameter[28] = new SqlParameter("@Mobile", partymaster.Mobile);
            parameter[29] = new SqlParameter("@OpeningBalance", partymaster.OpeningBalance);
            parameter[30] = new SqlParameter("@BalancePost", partymaster.BalancePost);
            parameter[31] = new SqlParameter("@AddressInBill", partymaster.AddressInBill);
            parameter[32] = new SqlParameter("@Lock", partymaster.Lock);
            parameter[33] = new SqlParameter("@Category", partymaster.Category);
            parameter[34] = new SqlParameter("@Broker", partymaster.Broker);
            parameter[35] = new SqlParameter("@Location", partymaster.Location);
            parameter[36] = new SqlParameter("@CollectGST", partymaster.CollectGST);
            parameter[37] = new SqlParameter("@RBILICNo", partymaster.RBILICNo);
            parameter[38] = new SqlParameter("@RBIExp", partymaster.RBIExp);
            parameter[39] = new SqlParameter("@ControlAC", partymaster.ControlAC);
            parameter[40] = new SqlParameter("@Id", partymaster.Id);
            parameter[41] = new SqlParameter("@IsDeleted", partymaster.IsDeleted);

            int i = dataInterfaceSQL.ExecuteNonQueryDB("spUpdatePartyMaster", parameter);

            return(i);
        }
        private void FillParty(PartyMaster obj)
        {
            string newLine = Environment.NewLine;

            if (obj != null)
            {
                txtPartyName.Text = obj.PartyName;
                txtAddress.Text   = obj.Address + newLine
                                    + "Phone: " + obj.ContactNo ?? "";
                txtContactNo.Text = obj.PersonName + newLine
                                    + "Mobile" + obj.Mobile ?? ""
                                    + "Email" + obj.EamilAddress ?? "";
            }
        }
        private PartyMaster GetMyProfile()
        {
            var    model = new PartyMaster();
            string cmd   = "Select * from PartyMaster where Msrno=" + gMSRNO;

            ds = fetchdata.GetDataSet(cmd);
            DataTable dt = new DataTable();

            if (ds.Tables.Count > 0)
            {
                dt    = ds.Tables[0];
                model = CommonMethod.ConvertToList <PartyMaster>(dt).FirstOrDefault();
            }
            return(model);
        }
Beispiel #21
0
        private PartyMaster GetProfileById(string id = "")
        {
            var    model = new PartyMaster();
            string cmd   = "Select * from PartyMaster where MemberId='" + id + "'";

            ds = fetchdata.GetDataSet(cmd);
            DataTable dt = new DataTable();

            if (ds.Tables.Count > 0)
            {
                dt    = ds.Tables[0];
                model = CommonMethod.ConvertToList <PartyMaster>(dt).FirstOrDefault();
            }
            return(model);
        }
        private PartyMaster GetItem()
        {
            PartyMaster obj = new PartyMaster();

            obj.PartyID   = txtPartyID.Text;
            obj.PartyName = txtPartyName.Text;

            obj.PersonName   = txtPersonName.Text;
            obj.Address      = txtAddress.Text;
            obj.ContactNo    = txtContactNo.Text;
            obj.Mobile       = txtMobile.Text;
            obj.EamilAddress = txtEmail.Text;
            obj.Remarks      = txtRemarks.Text;
            return(obj);
        }
Beispiel #23
0
            public override string Execute(string original)
            {
                original = original.Replace("${Gs2::Weave::FormationNamespaceName}", _installer.formationNamespaceName);
                original = original.Replace("${Gs2::Weave::MoldModelName}", _installer.moldModelName);
                original = original.Replace("${Gs2::Weave::FormModelName}", _installer.formModelName);
                original = original.Replace("${Gs2::Weave::PartyKeyNamespaceName}", _installer.keyNamespaceName);
                original = original.Replace("${Gs2::Weave::PartyKeyName}", _installer.keyName);
                original = original.Replace("${Gs2::Weave::NumberOfSaveArea}", _installer.numberOfSaveArea.ToString());
                original = original.Replace("${Gs2::Weave::NumberOfUnit}", _installer.numberOfUnit.ToString());

                {
                    var slots = new List <SlotModel>();
                    for (var i = 0; i < _installer.numberOfUnit; i++)
                    {
                        slots.Add(new SlotModel
                        {
                            name = i.ToString(),
                        });
                    }
                    var master = new PartyMaster
                    {
                        moldModels = new List <MoldModel>
                        {
                            new MoldModel
                            {
                                name = _installer.moldModelName,
                                initialMaxCapacity = _installer.numberOfSaveArea,
                                maxCapacity        = _installer.numberOfSaveArea,
                                formModel          = new FormModel
                                {
                                    name  = _installer.formModelName,
                                    slots = slots,
                                },
                            }
                        }
                    };

                    var stringBuilder = new StringBuilder();
                    var jsonWriter    = new JsonWriter(stringBuilder);
                    master.WriteJson(jsonWriter);

                    var json = JsonMapper.ToObject(original);
                    json["Resources"]["FormationSettings"]["Properties"]["Settings"] = stringBuilder.ToString();
                    original = json.ToJson();
                }

                return(original);
            }
Beispiel #24
0
        public void AddOrderWithParty(OrderMaster orderMaster, PartyMaster partyMaster, UserAddress userAddress)
        {
            _context.Add(partyMaster);
            _context.SaveChanges();

            if (partyMaster.Id > 0)
            {
                userAddress.PartyId = partyMaster.Id;
                _context.Add(userAddress);
                _context.SaveChanges();

                orderMaster.PartyId = partyMaster.Id;
                _context.Add(orderMaster);
                _context.SaveChanges();
            }
        }
        public ActionResult Register(PartyMaster model)
        {
            if (!CheckSponserId(model.SponsorId))
            {
                ViewBag._DisplayMsg = "Please enter a valid SponsorId";
                return(View(model));
            }
            IDbDataParameter[] param = new[]
            {
                CreateParameter(DbType.String, 50, "@PanNo", ParameterDirection.InputOutput, model.PanNo),
            };
            string cmd = "Select * from PartyMaster where PanNo=@PanNo";

            ds = fetchdata.GetDataSet(cmd, param, CommandType.Text);
            if (ds.Tables.Count > 0)
            {
                var dt = ds.Tables[0];

                var PartyMasterlist = CommonMethod.ConvertToList <PartyMaster>(dt).FirstOrDefault();
                if (PartyMasterlist == null)
                {
                    var UnigueUrl = Guid.NewGuid().ToString().Replace("-", "");
                    var OTP       = CreateEPin(7);
                    IDbDataParameter[] Insertparam = new[]
                    {
                        CreateParameter(DbType.String, 50, "@SponsorId", ParameterDirection.Input, model.SponsorId),
                        CreateParameter(DbType.String, 100, "@SponsorName", ParameterDirection.Input, model.SponsorName),
                        CreateParameter(DbType.String, 100, "@MemberName", ParameterDirection.Input, model.MemberName),
                        CreateParameter(DbType.String, 10, "@Sex", ParameterDirection.Input, model.Sex),
                        CreateParameter(DbType.String, 50, "@PanNo", ParameterDirection.Input, model.PanNo),
                        CreateParameter(DbType.String, 50, "@Mobile", ParameterDirection.Input, model.Mobile),
                        CreateParameter(DbType.String, 50, "@Email", ParameterDirection.Input, model.Email),
                        CreateParameter(DbType.String, 50, "@Password", ParameterDirection.Input, model.Password),
                        CreateParameter(DbType.String, 500, "@UnigueUrl", ParameterDirection.Input, UnigueUrl),
                        CreateParameter(DbType.String, 50, "@OTP", ParameterDirection.Input, OTP),
                        CreateParameter(DbType.String, 50, "@OUTMemberID", ParameterDirection.Output, ""),
                    };
                    cmd = "spInsertMember";
                    var memberid = fetchdata.ExecuteQuerySP(cmd, Insertparam, CommandType.StoredProcedure);
                    SendWelcomeMsg(model.Mobile, model.MemberName, memberid, model.Password);
                    return(RedirectToAction("Index"));
                }
            }
            ViewBag._DisplayMsg = "Please use different Pan number, this is already used";
            return(View(model));
        }
Beispiel #26
0
        public ActionResult AssignPin(int id, string q, string memberid, PartyMaster umodel, string btn = "")
        {
            if (btn == "Assign Pin")
            {
                SqlTransaction trans = fetchdata.GetTrans();


                IDbDataParameter[] param = new[]
                {
                    CreateParameter(DbType.String, 50, "@MemberId", ParameterDirection.Input, umodel.MemberId),
                    CreateParameter(DbType.String, 50, "@ETicket", ParameterDirection.Input, q),
                };
                string cmd = "Update PartyMaster set ETicket=@ETicket where MemberId=@MemberId";
                fetchdata.ExecuteQuery(cmd, param, trans, CommandType.Text);

                IDbDataParameter[] eparam = new[]
                {
                    CreateParameter(DbType.Int32, 50, "@PinId", ParameterDirection.Input, id),
                    CreateParameter(DbType.String, 50, "@ETicket", ParameterDirection.Input, q),
                };
                cmd = "Update eTicket set IsUsed=1 where PinId=@PinId";
                fetchdata.ExecuteQuery(cmd, eparam, trans, CommandType.Text);

                IDbDataParameter[] insertparam = new[]
                {
                    CreateParameter(DbType.String, 50, "@MemberID", ParameterDirection.Input, umodel.MemberId),
                    CreateParameter(DbType.Int32, 50, "@Msrno", ParameterDirection.Input, umodel.Msrno),
                    CreateParameter(DbType.Int32, 50, "@ETicketId", ParameterDirection.Input, id),
                    CreateParameter(DbType.DateTime, 50, "@Paiddt", ParameterDirection.Input, DateTime.Now),
                };
                string ncmd = "insert into GreenDetail(Msrno,MemberID,ETicketId,Paiddt) values(@Msrno,@MemberID,@ETicketId,@Paiddt)";
                fetchdata.ExecuteQuery(ncmd, insertparam, trans, CommandType.Text);

                trans.Commit();

                return(RedirectToAction("Index"));
            }
            else
            {
                PartyMaster model = GetProfileById(memberid);
                ViewBag.PinId   = id;
                ViewBag.ETicket = q;
                return(View(model));
            }
        }
Beispiel #27
0
 public JsonResult EditPartiesMaster(PartyMaster partymaster)
 {
     try
     {
         if (ModelState.IsValid)
         {
             MasterQueries masterQueries = new MasterQueries();
             int           res           = masterQueries.UpdatePartyMaster(partymaster);
             int           i             = masterQueries.SaveAdditionalData(partymaster.AdditionalData, (partymaster.Id.ToString()));
             return(Json(Functions.OutPutResponse(true, "Data Updated Succfully", partymaster)));
         }
     }
     catch (Exception ex)
     {
         return(Json(Functions.OutPutResponse(false, ex.Message)));
     }
     return(null);
 }
Beispiel #28
0
        public bool AddNewPartyMaster(PartyMaster obj)
        {
            OleDbParameter[] parameters = new OleDbParameter[]
            {
                new OleDbParameter("@PartyID", obj.PartyID),
                new OleDbParameter("@PartyName", obj.PartyName),
                new OleDbParameter("@PersonName", obj.PersonName),
                new OleDbParameter("@Address", obj.Address),
                new OleDbParameter("@ContactNo", obj.ContactNo),
                new OleDbParameter("@Mobile", obj.Mobile),
                new OleDbParameter("@EamilAddress", obj.EamilAddress),
                new OleDbParameter("@Remarks", obj.Remarks),
                new OleDbParameter("@CreatedOn", GlobalFunction.GetDateTimeWithoutMiliSecond(DateTime.Now))
            };
            string commandText = OleDBHelper.GetQueryText("PartyMaster_Insert", QueryType.Procedures);

            return(OleDBHelper.ExecuteNonQuery(commandText, CommandType.Text, parameters));
        }
        public ActionResult BankDetails(PartyMaster umodel)
        {
            IDbDataParameter[] Insertparam = new[]
            {
                CreateParameter(DbType.String, 50, "@AcNo", ParameterDirection.Input, umodel.AcNo),
                CreateParameter(DbType.String, 200, "@BankName", ParameterDirection.Input, umodel.BankName),
                CreateParameter(DbType.String, 50, "@BranchName", ParameterDirection.Input, umodel.BranchName),
                CreateParameter(DbType.String, 200, "@ISFC", ParameterDirection.Input, umodel.ISFC),
                CreateParameter(DbType.String, 50, "@AadharNo", ParameterDirection.Input, umodel.AadharNo),
                CreateParameter(DbType.String, 50, "@PanNo", ParameterDirection.Input, umodel.PanNo),
                CreateParameter(DbType.String, 50, "@MemberId", ParameterDirection.Input, umodel.MemberId),
            };
            var cmd = "Update PartyMaster set AcNo=@AcNo,BankName=@BankName,BranchName=@BranchName,ISFC=@ISFC,AadharNo=@AadharNo,PanNo=@PanNo where MemberId=@MemberId";

            fetchdata.ExecuteQuery(cmd, Insertparam, CommandType.Text);
            ViewBag._DisplayMsg = "Bank Details Updated";
            //var model = GetProfileById(umodel.MemberId);
            return(View(umodel));
        }
Beispiel #30
0
        private void ProcessLookUpOK()
        {
            PartyMasterSelected = new PartyMaster();
            int selectedIndex = dgvMain.SelectedRows[0].Index;

            if (selectedIndex != -1)
            {
                PartyMasterSelected.PartyID    = Convert.ToString(dgvMain.Rows[selectedIndex].Cells[PartyIDIndex].Value);
                PartyMasterSelected.PartyName  = Convert.ToString(dgvMain.Rows[selectedIndex].Cells[PartyNameIndex].Value);
                PartyMasterSelected.PersonName = Convert.ToString(dgvMain.Rows[selectedIndex].Cells[PersonNameIndex].Value);
                PartyMasterSelected.Address    = Convert.ToString(dgvMain.Rows[selectedIndex].Cells[AddressIndex].Value);
            }
            else
            {
                PartyMasterSelected = null;
            }

            this.DialogResult = DialogResult.OK;
        }