Exemplo n.º 1
0
        public static void UpdateParty(string code, string desc, string accode, string add1, string add2, string ph, string fax, string city, string det)
        {
            SQLAccess sq  = new SQLAccess(DbConfig.GetConStr("MAINDB"));
            string    qry = "update party set pname = '" + desc + "',p_acccode= '" + accode + "',address1 = '" + add1 + "',address2 = '" + add2 + "',phone = '" + ph + "', fax = '" + fax + "',city = '" + city + "',otherdetail = '" + det + "' where pcode = '" + code + "'";

            sq.ExecuteNonQuery(qry);
        }
Exemplo n.º 2
0
        public static void UpdateGroup(string code, string desc)
        {
            SQLAccess sq  = new SQLAccess(DbConfig.GetConStr("MAINDB"));
            string    qry = "update IGroup set gname = '" + desc + "' where gcode = '" + code + "'";

            sq.ExecuteNonQuery(qry);
        }
Exemplo n.º 3
0
        public static void DeleteItem(string code)
        {
            SQLAccess sq  = new SQLAccess(DbConfig.GetConStr("MAINDB"));
            string    qry = "delete from ItemMaster where itemcode = '" + code + "'";

            sq.ExecuteNonQuery(qry);
        }
Exemplo n.º 4
0
        public static void UpdateItem(string code, string desc, string grp, string unit, decimal rate, decimal qty, decimal val, string vendor)
        {
            SQLAccess sq  = new SQLAccess(DbConfig.GetConStr("MAINDB"));
            string    qry = "update ItemMaster set itemdesc = '" + desc + "',itemgp= '" + grp + "',unit = '" + unit + "',rate = " + rate + ",qty = " + qty + ", stockvalue =" + val + ",vendor = '" + vendor + "' where itemcode = '" + code + "'";

            sq.ExecuteNonQuery(qry);
        }
Exemplo n.º 5
0
        public static void UpdateGroup(string acode, string adesc, string type, decimal curbal)
        {
            SQLAccess sq = new SQLAccess(DbConfig.GetConStr("MAINDB"));

            sq.ExecuteNonQuery("Update  FAGroup set A_DESC='" + acode + "'," + "A_TYPE ='" + type + "',A_CURRB ='" +
                               curbal.ToString() + "' where A_CODE = '" + acode + "'");
        }
Exemplo n.º 6
0
        public static void DeleteGroup(string code)
        {
            SQLAccess sq  = new SQLAccess(DbConfig.GetConStr("MAINDB"));
            string    qry = "delete from IGroup where gcode = '" + code + "'";

            sq.ExecuteNonQuery(qry);
        }
Exemplo n.º 7
0
 public object Delete(string connectionstr, int UserId)
 {
     sqlacc          = new SQLAccess();
     cmd             = new SqlCommand();
     cmd.CommandType = CommandType.StoredProcedure;
     cmd.CommandText = "usp_tb_User";//Name of Stored Procedure
     cmd.Parameters.AddWithValue("@UserId", UserId);
     cmd.Parameters.AddWithValue("@Mode", 5);
     return(sqlacc.ExecuteNonQuery(connectionstr, cmd));
 }
Exemplo n.º 8
0
        public static void AddGroup(string code, string desc)
        {
            SQLAccess sqlacess = new SQLAccess(DbConfig.GetConStr("MAINDB"));
            string    qry      = "insert into IGroup values('" + code + "','" + desc + "')";

            if (!sqlacess.ExecuteNonQuery(qry))
            {
                return;
            }
        }
Exemplo n.º 9
0
        public static void AddParty(string code, string desc, string accode, string add1, string add2, string ph, string fax, string city, string det)
        {
            SQLAccess sqlacess = new SQLAccess(DbConfig.GetConStr("MAINDB"));
            string    qry      = "insert into party values('" + code + "','" + desc + "','" + accode + "','" + add1 + "','" + add2 + "','" + ph + "','" + fax + "','" + city + "','" + det + "')";

            if (!sqlacess.ExecuteNonQuery(qry))
            {
                return;
            }
        }
Exemplo n.º 10
0
        public static void AddItem(string code, string desc, string grp, string unit, decimal rate, decimal qty, decimal val, string vendor)
        {
            SQLAccess sqlacess = new SQLAccess(DbConfig.GetConStr("MAINDB"));
            string    qry      = "insert into ItemMaster values('" + code + "','" + desc + "','" + grp + "','" + unit + "'," + rate + "," + qty + "," + val + ",'" + vendor + "')";

            if (!sqlacess.ExecuteNonQuery(qry))
            {
                return;
            }
        }
Exemplo n.º 11
0
        public static void DeleteSubGroup(string scode)
        {
            // SPAccess sp = new SPAccess(DbConfig.GetConStr("MAINDB"));
            // sp.Add("@S_CODE", typeof(System.String), scode);
            // sp.ExecuteNonQuery("spDeleteFASubGroup");

            SQLAccess sq = new SQLAccess(DbConfig.GetConStr("MAINDB"));

            sq.ExecuteNonQuery("Delete from FASubGroup  where S_CODE = '" + scode + "'");
        }
Exemplo n.º 12
0
 public object CheckUser(string connectionstr, string EmailId, string Password)
 {
     sqlacc          = new SQLAccess();
     cmd             = new SqlCommand();
     cmd.CommandType = CommandType.StoredProcedure;
     cmd.CommandText = "usp_tb_User";//Name of Stored Procedure
     cmd.Parameters.AddWithValue("@EmailId", EmailId);
     cmd.Parameters.AddWithValue("@Password", Password);
     cmd.Parameters.AddWithValue("@Mode", 6);
     return(sqlacc.ExecuteNonQuery(connectionstr, cmd));
 }
Exemplo n.º 13
0
        public static bool DoPost(Transaction t)
        {
            SQLAccess sq = new SQLAccess(DbConfig.GetConStr("MAINDB"));

            try
            {
                string qry = "insert into TransactionMaster values('" + t.invo + "','" + t.cr + "','" + t.refno + "','" + DateTime.Now + "'," +
                             "'" + t.add + "','" + t.type + "'," + t.total + "," + t.gtotal + "," + t.discount + "," + t.freight + ",'" + t.cterms + "')";
                sq.ExecuteNonQuery(qry);
                List <TransactionEntry> te = t.rs;
                foreach (TransactionEntry ts in te)
                {
                    qry = "insert into transactionDetail values('" + t.invo + "','" + ts.iname + "'," + ts.qty + ",'" + ts.unit + "'," + ts.rate + "," + ts.val + ")";
                    sq.ExecuteNonQuery(qry);
                }

                return(true);
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
Exemplo n.º 14
0
        public static void AddGroup(string acode, string adesc, string type, decimal curbal)
        {
            //SPAccess sp = new SPAccess(DbConfig.GetConStr("MAINDB"));
            //sp.Add("@A_CODE", typeof(System.String), acode);
            //sp.Add("@A_DESC", typeof(System.String), adesc);
            //sp.Add("@A_TYPE", typeof(System.String), type);
            //sp.Add("@A_CURRB", typeof(System.Decimal), curbal);

            // sp.ExecuteNonQuery("spCreateFAGroup");

            SQLAccess sq = new SQLAccess(DbConfig.GetConStr("MAINDB"));

            sq.ExecuteNonQuery("INSERT into FAGroup values ('" + acode + "'," +
                               "'" + adesc + "'," + "'" + type + "'," + curbal.ToString() + ")");
        }
Exemplo n.º 15
0
        public static void AddSubGroup(string scode, string sdesc, string stype, decimal opbal, string drcr, string flag)
        {
            //SPAccess sp = new SPAccess(DbConfig.GetConStr("MAINDB"));
            //sp.Add("@S_CODE", typeof(System.String), scode);
            //sp.Add("@S_DESC", typeof(System.String), sdesc);
            //sp.Add("@S_TYPE", typeof(System.String), stype);
            //sp.Add("@S_OPBAL", typeof(System.String), opbal);
            //sp.Add("@S_DRCR", typeof(System.String), drcr);
            //sp.Add("@S_FLAG", typeof(System.String), flag);
            //sp.ExecuteNonQuery("spCreateFASubGroup");

            SQLAccess sq = new SQLAccess(DbConfig.GetConStr("MAINDB"));

            sq.ExecuteNonQuery("INSERT into FASubGroup values ('" + scode + "'," +
                               "'" + sdesc + "'," + "'" + stype + "'," + opbal.ToString() + ",'" + drcr + "','" + flag + "')");
        }
Exemplo n.º 16
0
        public static void UpdateSubGroup(string scode, string sdesc, string stype, decimal opbal, string drcr, string flag)
        {
            //SPAccess sp = new SPAccess(DbConfig.GetConStr("MAINDB"));
            //sp.Add("@S_CODE", typeof(System.String), scode);
            //sp.Add("@S_DESC", typeof(System.String), sdesc);
            //sp.Add("@S_TYPE", typeof(System.String), stype);
            //sp.Add("@S_OPBAL", typeof(System.String), opbal);
            //sp.Add("@S_DRCR", typeof(System.String), drcr);
            //sp.Add("@S_FLAG", typeof(System.String), flag);
            //sp.ExecuteNonQuery("spUpdateFASubGroup");

            SQLAccess sq = new SQLAccess(DbConfig.GetConStr("MAINDB"));

            sq.ExecuteNonQuery("Update  FASubGroup set S_DESC='" + sdesc + "'," + "S_TYPE ='" + stype + "',S_OPBAL ='" +
                               opbal.ToString() + "',S_DRCR='" + drcr + "',S_FLAG='" + flag + "'" + "  where S_CODE = '" + scode + "'");
        }
Exemplo n.º 17
0
 public object AddEdit(string connectionstr, UserModel usermodel, bool Insert)
 {
     sqlacc          = new SQLAccess();
     cmd             = new SqlCommand();
     cmd.CommandType = CommandType.StoredProcedure;
     cmd.CommandText = "usp_tb_User";//Name of Stored Procedure
     cmd.Parameters.AddWithValue("@UserId", usermodel.Id);
     cmd.Parameters.AddWithValue("@UserName", usermodel.UserName);
     cmd.Parameters.AddWithValue("@EmailId", usermodel.EmailId);
     cmd.Parameters.AddWithValue("@Mobile", usermodel.Mobile);
     cmd.Parameters.AddWithValue("@Address", usermodel.Address);
     cmd.Parameters.AddWithValue("@IsActive", usermodel.IsActive);
     if (Insert)
     {
         cmd.Parameters.AddWithValue("@Mode", 3);
     }
     else
     {
         cmd.Parameters.AddWithValue("@Mode", 4);
     }
     return(sqlacc.ExecuteNonQuery(connectionstr, cmd));
 }
Exemplo n.º 18
0
        public static void DeleteGroup(string acode)
        {
            SQLAccess sq = new SQLAccess(DbConfig.GetConStr("MAINDB"));

            sq.ExecuteNonQuery("Delete from FAGroup  where A_CODE = '" + acode + "'");
        }