public Inward getInwardDetails() { Validate _validate = new Validate(); Boolean isAllOk = true; Inward obj = new Inward(); obj.mkrid = Session["UserId"].ToString(); obj.mkrdt = DateTime.Now; if (_validate.isValidInput(txtDt, 10)) obj.ie_dt = DateTime.ParseExact(txtDt.Text, "yyyy-MM-dd", CultureInfo.InvariantCulture); else { isAllOk = false; showError("Invalid Date"); } if (!_validate.isNotSelected(ddlstInstmnt)) { obj.ie_instno = ddlstInstmnt.Text.Trim(); obj.ie_trxtype = new Process().getInstype(_validate.convertNumber(ddlstInstmnt.Text.Trim())); } else { isAllOk = false; showError("Select Instruction"); } if (!_validate.isNotSelected(ddllotNo)) obj.ie_lotno = _validate.convertNumber(ddllotNo.Text); else { isAllOk = false; showError("Select Lot"); } if (!_validate.isEmpty(txtlotsize)) { } else { isAllOk = false; showError("Invalid Lotsize"); } if (_validate.isNotNumber(txtSrNo)) { isAllOk = false; showError("Invalid Slipno"); } else { obj.ie_slipno = txtSrNo.Text.Trim(); } if (_validate.isValidInput(txtClid1)) obj.ie_cmcd = txtClid1.Text; else { isAllOk = false; showError("Invalid ClientID"); } if (_validate.isNotNumber(txtinst)) { isAllOk = false; showError("Invalid Instructions"); } else obj.ie_nooftrx = _validate.convertNumber(txtinst.Text.Trim()); if (ddlstInstmnt.SelectedItem.Text == "Demat") { if (_validate.isNotNumber(txtnoofcert)) { isAllOk = false; showError("Invalid No of certificates"); } else { obj.ie_noofcert = _validate.convertNumber(txtnoofcert.Text); } } obj.ie_execdt = DateTime.ParseExact(txtexecdt.Text, "yyyy-MM-dd", CultureInfo.InvariantCulture); if (_validate.isNotDecimal(txtcharges)) { isAllOk = false; showError("Invalid Charge"); } else obj.ie_charge = _validate.ConvertDecimal(txtcharges.Text.Trim()); if (!_validate.isEmpty(txtremarks)) obj.ie_remark = txtremarks.Text.Trim(); if (_validate.isNotSelected(ddl_mode_delivery)) { isAllOk = false; showError("Select Mode of delivery"); } else obj.ie_mode = ddl_mode_delivery.SelectedValue; if (isAllOk) return obj; else return null; }
public Inward GetInwardEntry(int scrollNo) { try { Inward_entry obj = new Inward_entry(); SingleEntities db = new SingleEntities(); obj = db.Inward_entry.Where(x => x.ie_scrollno == scrollNo).FirstOrDefault(); if (obj != null) { Inward objInw = new Inward(); objInw.ie_lotno = obj.ie_lotno; objInw.ie_trxtype = obj.ie_trxtype; objInw.ie_instno = obj.ie_instno; objInw.ie_slipno = obj.ie_slipno; objInw.ie_cmcd = obj.ie_cmcd; objInw.ie_dt = obj.ie_dt; objInw.ie_execdt = obj.ie_execdt; objInw.ie_nooftrx = obj.ie_nooftrx; objInw.ie_noofcert = obj.ie_noofcert; objInw.ie_rejected = obj.ie_rejected; objInw.ie_scrollno = obj.ie_scrollno; objInw.mkrid = obj.mkrid; objInw.mkrdt = obj.mkrdt; objInw.ie_charge = obj.ie_charge; objInw.ie_mode = obj.ie_mode; objInw.ie_remark = obj.ie_remark; objInw.ie_pri_key = obj.ie_pri_key; objInw.ie_branchcd = obj.ie_branchcd; return objInw; } else { return null; } } catch (Exception ex) { throw ex; } }
public int UpdateInwardEntry(Inward obj) { try { SingleEntities db = new SingleEntities(); Inward_entry objInw = db.Inward_entry.Where(x=>x.ie_scrollno == obj.ie_scrollno).First(); objInw.ie_lotno = obj.ie_lotno; objInw.ie_trxtype = obj.ie_trxtype.Trim(); objInw.ie_instno = obj.ie_instno.Trim(); objInw.ie_slipno = obj.ie_slipno.Trim(); objInw.ie_cmcd = obj.ie_cmcd.Trim(); objInw.ie_dt = obj.ie_dt; objInw.ie_execdt = obj.ie_execdt; objInw.ie_nooftrx = obj.ie_nooftrx; objInw.ie_noofcert = obj.ie_noofcert; objInw.ie_rejected = obj.ie_rejected; objInw.mkrid = obj.mkrid.Trim(); objInw.mkrdt = obj.mkrdt; objInw.ie_charge = obj.ie_charge; objInw.ie_mode = obj.ie_mode.Trim(); objInw.ie_remark = obj.ie_remark.Trim(); objInw.ie_pri_key = obj.ie_pri_key; objInw.ie_branchcd = obj.ie_branchcd.Trim(); return db.SaveChanges(); } catch (Exception ex) { throw ex; } }
public int AddInwardEntry(Inward obj) { try { Inward_entry objInw = new Inward_entry(); objInw.ie_lotno = obj.ie_lotno; objInw.ie_trxtype = obj.ie_trxtype.Trim(); objInw.ie_instno = obj.ie_instno.Trim(); objInw.ie_slipno = obj.ie_slipno.Trim(); objInw.ie_cmcd = obj.ie_cmcd.Trim(); objInw.ie_dt = obj.ie_dt; objInw.ie_execdt = obj.ie_execdt; objInw.ie_nooftrx = obj.ie_nooftrx; objInw.ie_noofcert = obj.ie_noofcert; objInw.ie_rejected = obj.ie_rejected; objInw.mkrid = obj.mkrid; objInw.mkrdt = obj.mkrdt; objInw.ie_charge = obj.ie_charge; objInw.ie_mode = obj.ie_mode; objInw.ie_remark = obj.ie_remark.Trim(); objInw.ie_pri_key = obj.ie_pri_key; objInw.ie_branchcd = obj.ie_branchcd; SingleEntities db = new SingleEntities(); db.Inward_entry.Add(objInw); return db.SaveChanges(); } catch (Exception ex) { throw ex; } }