public DataTable login(reg r) { SqlCommand cmd = new SqlCommand("select * from reg where Email=@eml and Pwd=@pwd", cs); cmd.Parameters.AddWithValue("@eml", r.Email); cmd.Parameters.AddWithValue("@pwd", r.Pwd); SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); return dt; }
public void InsertData(reg r) { SqlCommand cmd = new SqlCommand("insert into reg values(@nm,@eml,@pwd)", cs); cmd.Parameters.AddWithValue("@nm", r.Name); cmd.Parameters.AddWithValue("@eml", r.Email); cmd.Parameters.AddWithValue("@pwd", r.Pwd); cs.Open(); cmd.ExecuteNonQuery(); cs.Close(); }
public ActionResult reg(reg data) { try { if (ModelState.IsValid) { Session["UserId"] = data.UserId; Session["Mobileno"] = data.Mobileno; Session["Emailid"] = data.Emailid; db.regs.Add(data); db.SaveChanges(); ModelState.Clear(); return(RedirectToAction("Loginreg", "Rating")); } else { return(View()); } } catch (Exception ex) { return(RedirectToAction("Index")); } }
var(reg, range) = de;
public IHttpActionResult PostF_creg(List <Reglement> reglement) { List <reg> liste_reg = new List <reg>(); int rg = 0; try { rg = db.F_CREGLEMENT.Max(cc => cc.RG_No).Value; } catch { rg = 0; } foreach (var item in reglement) { F_CREGLEMENT f_creglement = new F_CREGLEMENT(); rg = rg + 1; f_creglement.RG_No = rg; f_creglement.CT_NumPayeur = item.CT_NumPayeur; f_creglement.RG_Date = System.DateTime.Now; f_creglement.RG_Reference = item.RG_Reference; f_creglement.RG_Libelle = item.RG_Libelle; f_creglement.RG_Montant = item.RG_Montant; f_creglement.RG_MontantDev = 0; try { string n_reglement = item.N_Reglement.ToString(); f_creglement.N_Reglement = short.Parse(n_reglement); } catch { f_creglement.N_Reglement = 0; } f_creglement.RG_Impute = 0; f_creglement.RG_Compta = 0; f_creglement.RG_Type = 0; f_creglement.RG_Cours = 0; f_creglement.N_Devise = 0; f_creglement.JO_Num = "CR1"; f_creglement.EC_No = 0; f_creglement.RG_Impaye = Convert.ToDateTime("1900-01-01").Date; f_creglement.CG_Num = "411000"; f_creglement.RG_TypeReg = 0; f_creglement.CA_No = 0; f_creglement.CO_NoCaissier = 0; f_creglement.RG_Banque = 0; f_creglement.RG_Transfere = 0; f_creglement.RG_Cloture = 0; f_creglement.RG_Ticket = 0; f_creglement.RG_Souche = 0; f_creglement.CT_NumPayeurOrig = item.CT_NumPayeur; f_creglement.RG_MontantEcart = 0; f_creglement.cbProt = 0; try { db.F_CREGLEMENT.Add(f_creglement); reg regl = new reg(); regl.id = item.id; regl.rg_no = f_creglement.RG_No.Value; liste_reg.Add(regl); } catch (Exception ex) { return(Ok(ex.InnerException.ToString())); } } db.SaveChanges(); return(Json(liste_reg)); }
public Registration() { regDelegate = new reg(goodreg); InitializeComponent(); }
public DataTable Login(reg r) { DAL d = new DAL(); return d.login(r); }