Ejemplo n.º 1
0
        public DbStatusEntity GetFogotPassword(string email)
        {
            DbStatusEntity objreturn = new DbStatusEntity();
            string         CS        = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;

            try
            {
                using (SqlConnection con = new SqlConnection(CS))
                {
                    SqlCommand cmd = new SqlCommand("USP_GetForgotPasswordDetails", con);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@EMAIL", email);

                    cmd.Parameters.Add("@RESULT", SqlDbType.Int);
                    cmd.Parameters["@RESULT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@CNT", SqlDbType.Int);
                    cmd.Parameters["@CNT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@MSG", SqlDbType.NVarChar, 500);
                    cmd.Parameters["@MSG"].Direction = ParameterDirection.Output;
                    con.Open();
                    cmd.ExecuteNonQuery();
                    objreturn.RESULT = Convert.ToInt32(cmd.Parameters["@RESULT"].Value);
                    objreturn.CNT    = Convert.ToInt32(cmd.Parameters["@CNT"].Value);
                    objreturn.MSG    = Convert.ToString(cmd.Parameters["@MSG"].Value);
                    con.Close();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(objreturn);
        }
Ejemplo n.º 2
0
        public DbStatusEntity ChangePassword(ChangePasswordEntity obj)
        {
            DbStatusEntity objreturn = new DbStatusEntity();
            string         CS        = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;

            try
            {
                using (SqlConnection con = new SqlConnection(CS))
                {
                    SqlCommand cmd = new SqlCommand("USP_UpdateNewPassword", con);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@USER_ID", obj.USER_ID);
                    cmd.Parameters.AddWithValue("@OLD_PASSWORD", CryptographyHelper.Instance.Encrypt(obj.OLD_PASSWORD));
                    cmd.Parameters.AddWithValue("@NEW_PASSWORD", CryptographyHelper.Instance.Encrypt(obj.NEW_PASSWORD));

                    cmd.Parameters.Add("@RESULT", SqlDbType.Int);
                    cmd.Parameters["@RESULT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@CNT", SqlDbType.Int);
                    cmd.Parameters["@CNT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@MSG", SqlDbType.NVarChar, 500);
                    cmd.Parameters["@MSG"].Direction = ParameterDirection.Output;
                    con.Open();
                    cmd.ExecuteNonQuery();
                    objreturn.RESULT = Convert.ToInt32(cmd.Parameters["@RESULT"].Value);
                    objreturn.CNT    = Convert.ToInt32(cmd.Parameters["@CNT"].Value);
                    objreturn.MSG    = Convert.ToString(cmd.Parameters["@MSG"].Value);
                    con.Close();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(objreturn);
        }
Ejemplo n.º 3
0
        public DbStatusEntity DeleteTaskStageMaster(int id)
        {
            DbStatusEntity objreturn = new DbStatusEntity();
            string         CS        = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;

            try
            {
                using (SqlConnection con = new SqlConnection(CS))
                {
                    SqlCommand cmd = new SqlCommand(TaskMasterQueries.DeleteTaskStageMaster, con);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@ID", id);

                    cmd.Parameters.Add("@RESULT", SqlDbType.Int);
                    cmd.Parameters["@RESULT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@CNT", SqlDbType.Int);
                    cmd.Parameters["@CNT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@MSG", SqlDbType.NVarChar, 500);
                    cmd.Parameters["@MSG"].Direction = ParameterDirection.Output;
                    con.Open();
                    cmd.ExecuteNonQuery();
                    objreturn.RESULT = Convert.ToInt32(cmd.Parameters["@RESULT"].Value);
                    objreturn.CNT    = Convert.ToInt32(cmd.Parameters["@CNT"].Value);
                    objreturn.MSG    = Convert.ToString(cmd.Parameters["@MSG"].Value);
                    con.Close();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(objreturn);
        }
Ejemplo n.º 4
0
        public DbStatusEntity UpdateCatalogImagesStatus(long id, string phy_file_name)
        {
            DbStatusEntity objreturn = new DbStatusEntity();
            string         CS        = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;

            try
            {
                using (SqlConnection con = new SqlConnection(CS))
                {
                    SqlCommand cmd = new SqlCommand("USP_UpdateCatalogImageStatus", con);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@ID", id);
                    cmd.Parameters.AddWithValue("@PHY_FILE_NAME", phy_file_name);

                    cmd.Parameters.Add("@RESULT", SqlDbType.Int);
                    cmd.Parameters["@RESULT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@CNT", SqlDbType.Int);
                    cmd.Parameters["@CNT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@MSG", SqlDbType.NVarChar, 500);
                    cmd.Parameters["@MSG"].Direction = ParameterDirection.Output;
                    con.Open();
                    cmd.ExecuteNonQuery();
                    objreturn.RESULT = Convert.ToInt32(cmd.Parameters["@RESULT"].Value);
                    objreturn.CNT    = Convert.ToInt32(cmd.Parameters["@CNT"].Value);
                    objreturn.MSG    = Convert.ToString(cmd.Parameters["@MSG"].Value);
                    con.Close();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(objreturn);
        }
Ejemplo n.º 5
0
        public DbStatusEntity UpdateOccasion(OccasionMasterEntity obj, int id)
        {
            DbStatusEntity objreturn = new DbStatusEntity();
            string         CS        = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;

            try
            {
                using (SqlConnection con = new SqlConnection(CS))
                {
                    SqlCommand cmd = new SqlCommand("USP_UpdateOccasionMaster", con);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@ID", id);
                    cmd.Parameters.AddWithValue("@NAME", obj.NAME);
                    cmd.Parameters.AddWithValue("@ACTIVE_STATUS", obj.ACTIVE_STATUS);

                    cmd.Parameters.Add("@RESULT", SqlDbType.Int);
                    cmd.Parameters["@RESULT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@CNT", SqlDbType.Int);
                    cmd.Parameters["@CNT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@MSG", SqlDbType.NVarChar, 500);
                    cmd.Parameters["@MSG"].Direction = ParameterDirection.Output;
                    con.Open();
                    cmd.ExecuteNonQuery();
                    objreturn.RESULT = Convert.ToInt32(cmd.Parameters["@RESULT"].Value);
                    objreturn.CNT    = Convert.ToInt32(cmd.Parameters["@CNT"].Value);
                    objreturn.MSG    = Convert.ToString(cmd.Parameters["@MSG"].Value);
                    con.Close();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(objreturn);
        }
Ejemplo n.º 6
0
        public DbStatusEntity UpdateLedgerMaster(LedgerMasterEntity obj, int id)
        {
            DbStatusEntity objreturn = new DbStatusEntity();
            string         CS        = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;

            try
            {
                using (SqlConnection con = new SqlConnection(CS))
                {
                    SqlCommand cmd = new SqlCommand("USP_UpdateLedgerMaster", con);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@ID", id);
                    cmd.Parameters.AddWithValue("@NAME", obj.NAME);
                    cmd.Parameters.AddWithValue("@ALIAS_NAME", obj.ALIAS_NAME);
                    cmd.Parameters.AddWithValue("@LEDGER_TYPE_ID", obj.LEDGER_TYPE_ID);
                    cmd.Parameters.AddWithValue("@ADDRESS", obj.ADDRESS);
                    cmd.Parameters.AddWithValue("@CITY", obj.CITY);
                    cmd.Parameters.AddWithValue("@STATE", obj.STATE);
                    cmd.Parameters.AddWithValue("@PIN_NO", obj.PIN_NO);
                    cmd.Parameters.AddWithValue("@MOBILE", obj.MOBILE);
                    cmd.Parameters.AddWithValue("@TELEPHONE", obj.TELEPHONE);
                    cmd.Parameters.AddWithValue("@EMAIL", obj.EMAIL);
                    cmd.Parameters.AddWithValue("@WEB", obj.WEB);
                    cmd.Parameters.AddWithValue("@GSTIN", obj.GSTIN);
                    cmd.Parameters.AddWithValue("@REMARKS", obj.REMARKS);
                    cmd.Parameters.AddWithValue("@ACTIVE_STATUS", obj.ACTIVE_STATUS);

                    cmd.Parameters.Add("@RESULT", SqlDbType.Int);
                    cmd.Parameters["@RESULT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@CNT", SqlDbType.Int);
                    cmd.Parameters["@CNT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@MSG", SqlDbType.NVarChar, 500);
                    cmd.Parameters["@MSG"].Direction = ParameterDirection.Output;
                    con.Open();
                    cmd.ExecuteNonQuery();
                    objreturn.RESULT = Convert.ToInt32(cmd.Parameters["@RESULT"].Value);
                    objreturn.CNT    = Convert.ToInt32(cmd.Parameters["@CNT"].Value);
                    objreturn.MSG    = Convert.ToString(cmd.Parameters["@MSG"].Value);
                    con.Close();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(objreturn);
        }
Ejemplo n.º 7
0
        public DbStatusEntity UpdateClientCredentials(ClientCredentialsEntity obj)
        {
            DbStatusEntity objreturn = new DbStatusEntity();
            string         CS        = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;

            try
            {
                using (SqlConnection con = new SqlConnection(CS))
                {
                    SqlCommand cmd = new SqlCommand("USP_UpdateClientCredentials", con);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@ID", obj.ID);
                    cmd.Parameters.AddWithValue("@CLIENT_ID", obj.CLIENT_ID);
                    cmd.Parameters.AddWithValue("@SITE_NAME", obj.SITE_NAME);
                    cmd.Parameters.AddWithValue("@URL", obj.URL);
                    cmd.Parameters.AddWithValue("@UNAME", obj.UNAME);
                    cmd.Parameters.AddWithValue("@UPASS", obj.UPASS);
                    cmd.Parameters.AddWithValue("@REMARKS", obj.REMARKS);

                    cmd.Parameters.Add("@RESULT", SqlDbType.Int);
                    cmd.Parameters["@RESULT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@CNT", SqlDbType.Int);
                    cmd.Parameters["@CNT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@MSG", SqlDbType.NVarChar, 500);
                    cmd.Parameters["@MSG"].Direction = ParameterDirection.Output;
                    con.Open();
                    cmd.ExecuteNonQuery();
                    objreturn.RESULT = Convert.ToInt32(cmd.Parameters["@RESULT"].Value);
                    objreturn.CNT    = Convert.ToInt32(cmd.Parameters["@CNT"].Value);
                    objreturn.MSG    = Convert.ToString(cmd.Parameters["@MSG"].Value);
                    con.Close();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(objreturn);
        }
Ejemplo n.º 8
0
        public DbStatusEntity UpdateUserMaster(UserMasterEntity obj, int id)
        {
            DbStatusEntity objreturn = new DbStatusEntity();
            string         CS        = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;

            try
            {
                using (SqlConnection con = new SqlConnection(CS))
                {
                    SqlCommand cmd = new SqlCommand("USP_UpdateUsersMaster", con);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@USER_ID", id);
                    cmd.Parameters.AddWithValue("@USER_PASSWORD", CryptographyHelper.Instance.Encrypt(obj.USER_PASSWORD));
                    cmd.Parameters.AddWithValue("@NAME", obj.NAME);
                    cmd.Parameters.AddWithValue("@EMAIL", obj.EMAIL);
                    cmd.Parameters.AddWithValue("@MOBILE_NO", obj.MOBILE_NO);
                    cmd.Parameters.AddWithValue("@ACTIVE_STATUS", obj.ACTIVE_STATUS);
                    cmd.Parameters.AddWithValue("@ROLE_ID", obj.ROLE_ID);

                    cmd.Parameters.Add("@RESULT", SqlDbType.Int);
                    cmd.Parameters["@RESULT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@CNT", SqlDbType.Int);
                    cmd.Parameters["@CNT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@MSG", SqlDbType.NVarChar, 500);
                    cmd.Parameters["@MSG"].Direction = ParameterDirection.Output;
                    con.Open();
                    cmd.ExecuteNonQuery();
                    objreturn.RESULT = Convert.ToInt32(cmd.Parameters["@RESULT"].Value);
                    objreturn.CNT    = Convert.ToInt32(cmd.Parameters["@CNT"].Value);
                    objreturn.MSG    = Convert.ToString(cmd.Parameters["@MSG"].Value);
                    con.Close();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(objreturn);
        }
Ejemplo n.º 9
0
        public DbStatusEntity InsertBanner(BannerImageEntity obj)
        {
            DbStatusEntity objreturn = new DbStatusEntity();
            string         CS        = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;

            try
            {
                using (SqlConnection con = new SqlConnection(CS))
                {
                    SqlCommand cmd = new SqlCommand("USP_InsertBannerMaster", con);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@HEADING", obj.HEADING);
                    cmd.Parameters.AddWithValue("@DESCRIPTION", obj.DESCRIPTION);
                    cmd.Parameters.AddWithValue("@ORG_FILE_NAME", obj.ORG_FILE_NAME);
                    cmd.Parameters.AddWithValue("@PHY_FILE_NAME", obj.PHY_FILE_NAME);
                    cmd.Parameters.AddWithValue("@FCOLOR", obj.FCOLOR);

                    cmd.Parameters.Add("@RESULT", SqlDbType.Int);
                    cmd.Parameters["@RESULT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@CNT", SqlDbType.Int);
                    cmd.Parameters["@CNT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@MSG", SqlDbType.NVarChar, 500);
                    cmd.Parameters["@MSG"].Direction = ParameterDirection.Output;
                    con.Open();
                    cmd.ExecuteNonQuery();
                    objreturn.RESULT = Convert.ToInt32(cmd.Parameters["@RESULT"].Value);
                    objreturn.CNT    = Convert.ToInt32(cmd.Parameters["@CNT"].Value);
                    objreturn.MSG    = Convert.ToString(cmd.Parameters["@MSG"].Value);
                    con.Close();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(objreturn);
        }
Ejemplo n.º 10
0
        public DbStatusEntity InsertTaskAbortTrn(Int64 T_ID, Int64 C_ID, string SCH_ON, Int64 userid)
        {
            DbStatusEntity objreturn = new DbStatusEntity();
            string         CS        = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;

            try
            {
                using (SqlConnection con = new SqlConnection(CS))
                {
                    SqlCommand cmd = new SqlCommand("USP_InsertTaskAbortTrn", con);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@C_ID", C_ID);
                    cmd.Parameters.AddWithValue("@TM_ID", T_ID);
                    cmd.Parameters.AddWithValue("@SCH_ON", SCH_ON);
                    cmd.Parameters.AddWithValue("@USER_ID", userid);

                    cmd.Parameters.Add("@RESULT", SqlDbType.Int);
                    cmd.Parameters["@RESULT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@CNT", SqlDbType.Int);
                    cmd.Parameters["@CNT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@MSG", SqlDbType.NVarChar, 500);
                    cmd.Parameters["@MSG"].Direction = ParameterDirection.Output;
                    con.Open();
                    cmd.ExecuteNonQuery();
                    objreturn.RESULT = Convert.ToInt32(cmd.Parameters["@RESULT"].Value);
                    objreturn.CNT    = Convert.ToInt32(cmd.Parameters["@CNT"].Value);
                    objreturn.MSG    = Convert.ToString(cmd.Parameters["@MSG"].Value);
                    con.Close();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(objreturn);
        }
Ejemplo n.º 11
0
        public DbStatusEntity InsertBarcode(Int64 id, string genid)
        {
            DbStatusEntity objreturn            = new DbStatusEntity();
            string         CS                   = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;
            DataSet        ds                   = new DataSet();
            List <JewelleryMasterEntity> retlst = new List <JewelleryMasterEntity>();

            try
            {
                using (SqlConnection con = new SqlConnection(CS))
                {
                    SqlCommand cmd = new SqlCommand("USP_InsertBarcode", con);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@CATALOG_ID", id);
                    cmd.Parameters.AddWithValue("@GENID", genid);

                    cmd.Parameters.Add("@RESULT", SqlDbType.Int);
                    cmd.Parameters["@RESULT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@CNT", SqlDbType.Int);
                    cmd.Parameters["@CNT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@MSG", SqlDbType.NVarChar, 500);
                    cmd.Parameters["@MSG"].Direction = ParameterDirection.Output;
                    con.Open();
                    cmd.ExecuteNonQuery();
                    objreturn.RESULT = Convert.ToInt32(cmd.Parameters["@RESULT"].Value);
                    objreturn.CNT    = Convert.ToInt32(cmd.Parameters["@CNT"].Value);
                    objreturn.MSG    = Convert.ToString(cmd.Parameters["@MSG"].Value);
                    con.Close();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(objreturn);
        }
Ejemplo n.º 12
0
        public DbStatusEntity UpdateRolesMenu(List <RoleSelectedMenuEntity> obj, int id)
        {
            DbStatusEntity objreturn = new DbStatusEntity();
            string         CS        = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;

            try
            {
                using (SqlConnection con = new SqlConnection(CS))
                {
                    SqlCommand cmd = new SqlCommand("USP_UpdateRolesMenu", con);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@ID", id);

                    SqlParameter sqlParam = cmd.Parameters.AddWithValue("@TVP", CreateDataTable(obj));
                    sqlParam.SqlDbType = SqlDbType.Structured;

                    cmd.Parameters.Add("@RESULT", SqlDbType.Int);
                    cmd.Parameters["@RESULT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@CNT", SqlDbType.Int);
                    cmd.Parameters["@CNT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@MSG", SqlDbType.NVarChar, 500);
                    cmd.Parameters["@MSG"].Direction = ParameterDirection.Output;
                    con.Open();
                    cmd.ExecuteNonQuery();
                    objreturn.RESULT = Convert.ToInt32(cmd.Parameters["@RESULT"].Value);
                    objreturn.CNT    = Convert.ToInt32(cmd.Parameters["@CNT"].Value);
                    objreturn.MSG    = Convert.ToString(cmd.Parameters["@MSG"].Value);
                    con.Close();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(objreturn);
        }
Ejemplo n.º 13
0
        public DbStatusEntity InsertCatalog(CatalogMasterEntity obj)
        {
            DbStatusEntity objreturn = new DbStatusEntity();
            string         CS        = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;

            try
            {
                using (SqlConnection con = new SqlConnection(CS))
                {
                    SqlCommand cmd = new SqlCommand("USP_InsertCatalogMaster", con);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@CODE", obj.CODE);
                    cmd.Parameters.AddWithValue("@TITLE", obj.TITLE);
                    cmd.Parameters.AddWithValue("@REMARKS", obj.REMARKS);
                    cmd.Parameters.AddWithValue("@ACTIVE_STATUS", obj.ACTIVE_STATUS);
                    cmd.Parameters.AddWithValue("@SHOW_CATALOG", obj.SHOW_CATALOG);
                    cmd.Parameters.AddWithValue("@SHOW_TRENDING", obj.SHOW_TRENDING);
                    cmd.Parameters.AddWithValue("@JEWELLERY_ID", obj.JEWELLERY_ID);
                    cmd.Parameters.AddWithValue("@DESIGN_ID", obj.DESIGN_ID);
                    cmd.Parameters.AddWithValue("@COLLECTIONS_ID", obj.COLLECTIONS_ID);
                    cmd.Parameters.AddWithValue("@MATERIAL_ID", obj.MATERIAL_ID);
                    cmd.Parameters.AddWithValue("@OCCASION_ID", obj.OCCASION_ID);
                    cmd.Parameters.AddWithValue("@GRAMSLAB_ID", obj.GRAMSLAB_ID);
                    cmd.Parameters.AddWithValue("@KARAT_ID", obj.KARAT_ID);
                    cmd.Parameters.AddWithValue("@PURITY", obj.PURITY);
                    cmd.Parameters.AddWithValue("@RATE", obj.RATE);
                    cmd.Parameters.AddWithValue("@GR_WT", obj.GR_WT);
                    cmd.Parameters.AddWithValue("@ST_WT", obj.ST_WT);
                    cmd.Parameters.AddWithValue("@NET_WT", obj.NET_WT);
                    cmd.Parameters.AddWithValue("@VA_PER", obj.VA_PER);
                    cmd.Parameters.AddWithValue("@VA_AMT", obj.VA_AMT);
                    cmd.Parameters.AddWithValue("@ST_AMT", obj.ST_AMT);
                    cmd.Parameters.AddWithValue("@TAXABLE_AMT", obj.TAXABLE_AMT);
                    cmd.Parameters.AddWithValue("@TAX_PER", obj.TAX_PER);
                    cmd.Parameters.AddWithValue("@TAX_AMT", obj.TAX_AMT);
                    cmd.Parameters.AddWithValue("@NET_AMT", obj.NET_AMT);
                    cmd.Parameters.AddWithValue("@S_PER", obj.S_PER);
                    cmd.Parameters.AddWithValue("@DATE_YM", obj.DATE_YM);
                    cmd.Parameters.AddWithValue("@LED_NAME", obj.LED_NAME);
                    cmd.Parameters.AddWithValue("@DIA_CARAT", obj.DIA_CARAT);
                    cmd.Parameters.AddWithValue("@PCS", obj.PCS);
                    cmd.Parameters.Add("@RESULT", SqlDbType.Int);
                    cmd.Parameters["@RESULT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@CNT", SqlDbType.Int);
                    cmd.Parameters["@CNT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@MSG", SqlDbType.NVarChar, 500);
                    cmd.Parameters["@MSG"].Direction = ParameterDirection.Output;
                    con.Open();
                    cmd.ExecuteNonQuery();
                    objreturn.RESULT = Convert.ToInt32(cmd.Parameters["@RESULT"].Value);
                    objreturn.CNT    = Convert.ToInt32(cmd.Parameters["@CNT"].Value);
                    objreturn.MSG    = Convert.ToString(cmd.Parameters["@MSG"].Value);
                    con.Close();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(objreturn);
        }
Ejemplo n.º 14
0
        public DbStatusEntity InsertStockEntry(StockEntryInsertParam1 obj, StockEntryInsertParam2[] obj2, Int64 userid)
        {
            DataTable      dtsub     = new DataTable();
            DbStatusEntity objreturn = new DbStatusEntity();
            string         CS        = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;

            try
            {
                dtsub.Columns.Add("CATALOG_ID", typeof(Int64));
                dtsub.Columns.Add("SKU", typeof(string));
                dtsub.Columns.Add("CODE", typeof(string));
                dtsub.Columns.Add("CATALOG_TITLE", typeof(string));
                dtsub.Columns.Add("QTY", typeof(double));
                dtsub.Columns.Add("REMARKS", typeof(string));
                dtsub.Columns.Add("GENID", typeof(string));
                foreach (StockEntryInsertParam2 ob in obj2)
                {
                    DataRow dr = dtsub.NewRow();
                    dr["CATALOG_ID"]    = ob.ID;
                    dr["SKU"]           = ob.SKU;
                    dr["CODE"]          = ob.CODE;
                    dr["CATALOG_TITLE"] = ob.TITLE;
                    dr["QTY"]           = ob.QTY;
                    dr["REMARKS"]       = ob.REMARKS;
                    dr["GENID"]         = ob.GENID;
                    dtsub.Rows.Add(dr);
                }
                dtsub.AcceptChanges();

                using (SqlConnection con = new SqlConnection(CS))
                {
                    SqlCommand cmd = new SqlCommand("USP_InsertStockEntry", con);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@LED_NAME", obj.LED_NAME);
                    cmd.Parameters.AddWithValue("@TRANS_DATE", obj.TRANS_DATE);
                    cmd.Parameters.AddWithValue("@REF_NO", obj.REF_NO);
                    cmd.Parameters.AddWithValue("@REMARKS", obj.REMARKS);
                    cmd.Parameters.AddWithValue("@USER_ID", userid);

                    SqlParameter sqlParam = cmd.Parameters.AddWithValue("@TVP", dtsub);
                    sqlParam.SqlDbType = SqlDbType.Structured;

                    cmd.Parameters.Add("@RESULT", SqlDbType.Int);
                    cmd.Parameters["@RESULT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@CNT", SqlDbType.Int);
                    cmd.Parameters["@CNT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@MSG", SqlDbType.NVarChar, 500);
                    cmd.Parameters["@MSG"].Direction = ParameterDirection.Output;
                    con.Open();
                    cmd.ExecuteNonQuery();
                    objreturn.RESULT = Convert.ToInt32(cmd.Parameters["@RESULT"].Value);
                    objreturn.CNT    = Convert.ToInt32(cmd.Parameters["@CNT"].Value);
                    objreturn.MSG    = Convert.ToString(cmd.Parameters["@MSG"].Value);
                    con.Close();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(objreturn);
        }
Ejemplo n.º 15
0
        public DbStatusEntity UpdateBill(BillParamEntity obj, Int64 id)
        {
            DbStatusEntity objreturn = new DbStatusEntity();
            string         CS        = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;

            try
            {
                using (SqlConnection con = new SqlConnection(CS))
                {
                    SqlCommand cmd = new SqlCommand("USP_UpdateBill", con);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@BILL_ID", id);
                    cmd.Parameters.AddWithValue("@C_ID", obj.C_ID);
                    cmd.Parameters.AddWithValue("@C_NO", obj.C_NO);
                    cmd.Parameters.AddWithValue("@FILE_NO", obj.FILE_NO);
                    cmd.Parameters.AddWithValue("@C_NAME", obj.C_NAME);
                    cmd.Parameters.AddWithValue("@BILL_DATE", obj.BILL_DATE);
                    cmd.Parameters.AddWithValue("@DUE_DATE", obj.DUE_DATE);
                    cmd.Parameters.AddWithValue("@PAYMODE_ID", obj.PAYMODE_ID);
                    cmd.Parameters.AddWithValue("@PAYMODE_NAME", obj.PAYMODE_NAME);
                    cmd.Parameters.AddWithValue("@TASK_ID", obj.TASK_ID);
                    cmd.Parameters.AddWithValue("@TASK_NO", obj.TASK_NO);
                    cmd.Parameters.AddWithValue("@GROSS_AMT", obj.GROSS_AMT);
                    cmd.Parameters.AddWithValue("@SGST_AMT", obj.SGST_AMT);
                    cmd.Parameters.AddWithValue("@CGST_AMT", obj.CGST_AMT);
                    cmd.Parameters.AddWithValue("@IGST_AMT", obj.IGST_AMT);
                    cmd.Parameters.AddWithValue("@OTH_AMT", obj.OTH_AMT);
                    cmd.Parameters.AddWithValue("@NET_AMT", obj.NET_AMT);
                    cmd.Parameters.AddWithValue("@REMARKS", obj.REMARKS);


                    DataTable dtsub = new DataTable();
                    dtsub.Columns.Add("SL_NO", typeof(int));
                    dtsub.Columns.Add("DESCP", typeof(string));
                    dtsub.Columns.Add("GROSS_AMT", typeof(Double));
                    dtsub.Columns.Add("SGST_PER", typeof(Double));
                    dtsub.Columns.Add("SGST_AMT", typeof(Double));
                    dtsub.Columns.Add("CGST_PER", typeof(Double));
                    dtsub.Columns.Add("CGST_AMT", typeof(Double));
                    dtsub.Columns.Add("IGST_PER", typeof(Double));
                    dtsub.Columns.Add("IGST_AMT", typeof(Double));
                    dtsub.Columns.Add("NET_AMT", typeof(Double));
                    dtsub.Columns.Add("REMARKS", typeof(string));


                    foreach (BillSubEntity objsub in obj.SUBARRAY)
                    {
                        DataRow dr = dtsub.NewRow();
                        dr["SL_NO"]     = objsub.SL_NO;
                        dr["DESCP"]     = objsub.DESCP;
                        dr["GROSS_AMT"] = objsub.GROSS_AMT;
                        dr["SGST_PER"]  = objsub.SGST_PER;
                        dr["SGST_AMT"]  = objsub.SGST_AMT;
                        dr["CGST_PER"]  = objsub.CGST_PER;
                        dr["CGST_AMT"]  = objsub.CGST_AMT;
                        dr["IGST_PER"]  = objsub.IGST_PER;
                        dr["IGST_AMT"]  = objsub.IGST_AMT;
                        dr["NET_AMT"]   = objsub.NET_AMT;
                        dr["REMARKS"]   = objsub.REMARKS;
                        dtsub.Rows.Add(dr);
                    }

                    SqlParameter sqlParam = cmd.Parameters.AddWithValue("@TVP", dtsub);
                    sqlParam.SqlDbType = SqlDbType.Structured;

                    cmd.Parameters.Add("@RESULT", SqlDbType.Int);
                    cmd.Parameters["@RESULT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@CNT", SqlDbType.Int);
                    cmd.Parameters["@CNT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@MSG", SqlDbType.NVarChar, 500);
                    cmd.Parameters["@MSG"].Direction = ParameterDirection.Output;
                    con.Open();
                    cmd.ExecuteNonQuery();
                    objreturn.RESULT = Convert.ToInt32(cmd.Parameters["@RESULT"].Value);
                    objreturn.CNT    = Convert.ToInt32(cmd.Parameters["@CNT"].Value);
                    objreturn.MSG    = Convert.ToString(cmd.Parameters["@MSG"].Value);
                    con.Close();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(objreturn);
        }
Ejemplo n.º 16
0
        public DbStatusEntity InsertClient(ClientMasterEntity obj)
        {
            DbStatusEntity objreturn = new DbStatusEntity();
            string         CS        = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;

            try
            {
                using (SqlConnection con = new SqlConnection(CS))
                {
                    SqlCommand cmd = new SqlCommand("USP_InsertClientMaster", con);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@FILE_NO", obj.FILE_NO);
                    cmd.Parameters.AddWithValue("@C_NAME", obj.C_NAME);
                    cmd.Parameters.AddWithValue("@ALIAS", obj.ALIAS);
                    cmd.Parameters.AddWithValue("@FNAME", obj.FNAME);
                    cmd.Parameters.AddWithValue("@HNAME", obj.HNAME);
                    cmd.Parameters.AddWithValue("@GENDER", obj.GENDER);
                    cmd.Parameters.AddWithValue("@SAME_AB", obj.SAME_AB);
                    cmd.Parameters.AddWithValue("@ADDR", obj.ADDR);
                    cmd.Parameters.AddWithValue("@ADDR1", obj.ADDR1);
                    cmd.Parameters.AddWithValue("@CITY", obj.CITY);
                    cmd.Parameters.AddWithValue("@CITY1", obj.CITY1);
                    cmd.Parameters.AddWithValue("@PIN", obj.PIN);
                    cmd.Parameters.AddWithValue("@PIN1", obj.PIN1);
                    cmd.Parameters.AddWithValue("@STATE", obj.STATE);
                    cmd.Parameters.AddWithValue("@STATE1", obj.STATE1);
                    cmd.Parameters.AddWithValue("@CNT_NAME", obj.CNT_NAME);
                    cmd.Parameters.AddWithValue("@PH_NO", obj.PH_NO);
                    cmd.Parameters.AddWithValue("@MOBILE_NO1", obj.MOBILE_NO1);
                    cmd.Parameters.AddWithValue("@MOBILE_NO2", obj.MOBILE_NO2);
                    cmd.Parameters.AddWithValue("@EMAIL_ID", obj.EMAIL_ID);
                    cmd.Parameters.AddWithValue("@DOB", obj.DOB);
                    cmd.Parameters.AddWithValue("@PAN", obj.PAN);
                    cmd.Parameters.AddWithValue("@AADHAAR", obj.AADHAAR);
                    cmd.Parameters.AddWithValue("@GSTIN", obj.GSTIN);
                    cmd.Parameters.AddWithValue("@WARD", obj.WARD);
                    cmd.Parameters.AddWithValue("@RACK_NO", obj.RACK_NO);
                    cmd.Parameters.AddWithValue("@CLI_GRP_ID", obj.CLI_GRP_ID);
                    cmd.Parameters.AddWithValue("@Alert_Msg", obj.ALERT_MSG);
                    cmd.Parameters.AddWithValue("@ClientCategoryStringList", obj.ClientCategoryStringList);
                    cmd.Parameters.AddWithValue("@ACTIVE_STATUS", obj.ACTIVE_STATUS);

                    cmd.Parameters.Add("@RESULT", SqlDbType.Int);
                    cmd.Parameters["@RESULT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@CNT", SqlDbType.Int);
                    cmd.Parameters["@CNT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@MSG", SqlDbType.NVarChar, 500);
                    cmd.Parameters["@MSG"].Direction = ParameterDirection.Output;
                    con.Open();
                    cmd.ExecuteNonQuery();
                    objreturn.RESULT = Convert.ToInt32(cmd.Parameters["@RESULT"].Value);
                    objreturn.CNT    = Convert.ToInt32(cmd.Parameters["@CNT"].Value);
                    objreturn.MSG    = Convert.ToString(cmd.Parameters["@MSG"].Value);
                    con.Close();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(objreturn);
        }
Ejemplo n.º 17
0
        public DbStatusEntity UpdateTaskMaster(TaskMasterParamEntity obj, Int64 id)
        {
            DbStatusEntity objreturn = new DbStatusEntity();
            string         CS        = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;

            try
            {
                using (SqlConnection con = new SqlConnection(CS))
                {
                    SqlCommand cmd = new SqlCommand("USP_UpdateTaskMaster", con);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@T_ID", id);
                    cmd.Parameters.AddWithValue("@T_NAME", obj.T_NAME);
                    cmd.Parameters.AddWithValue("@T_DESC", obj.T_DESC);
                    cmd.Parameters.AddWithValue("@PRIORITY", obj.PRIORITY);
                    cmd.Parameters.AddWithValue("@RECURRING_TYPE", obj.RECURRING_TYPE);
                    cmd.Parameters.AddWithValue("@RECURRING_DAYS", obj.RECURRING_DAYS);
                    cmd.Parameters.AddWithValue("@RECURRING_START_DAY", obj.RECURRING_START_DAY);
                    cmd.Parameters.AddWithValue("@RECURRING_START_DATE", obj.RECURRING_START_DATE);
                    cmd.Parameters.AddWithValue("@RECURRING_END_DATE", obj.RECURRING_END_DATE);
                    cmd.Parameters.AddWithValue("@ACTIVE_STATUS", obj.ACTIVE_STATUS);
                    cmd.Parameters.AddWithValue("@MAPPED_CLIENTS", obj.MAPPED_CLIENTS);
                    cmd.Parameters.AddWithValue("@MAPPED_CLI_CAT", obj.MAPPED_CLI_CAT);

                    DataTable dtsub = new DataTable();
                    dtsub.Columns.Add("TS_ID", typeof(int));
                    dtsub.Columns.Add("TS_NAME", typeof(string));
                    dtsub.Columns.Add("USER_ID", typeof(int));
                    dtsub.Columns.Add("SL_NO", typeof(int));

                    foreach (TaskMasterSubParamEntity objsub in obj.SUBARR)
                    {
                        DataRow dr = dtsub.NewRow();
                        dr["TS_ID"]   = 0;
                        dr["TS_NAME"] = objsub.STAGE;
                        dr["USER_ID"] = objsub.USER_ID;
                        dr["SL_NO"]   = objsub.SLNO;
                        dtsub.Rows.Add(dr);
                    }

                    SqlParameter sqlParam = cmd.Parameters.AddWithValue("@TVP", dtsub);
                    sqlParam.SqlDbType = SqlDbType.Structured;

                    DataTable dtdocs = new DataTable();
                    dtdocs.Columns.Add("SL_NO", typeof(int));
                    dtdocs.Columns.Add("DOC_NAME", typeof(string));

                    foreach (TaskDocumentEntity objdoc in obj.DOCARR)
                    {
                        DataRow dr = dtdocs.NewRow();
                        dr["SL_NO"]    = objdoc.SL_NO;
                        dr["DOC_NAME"] = objdoc.DOC_NAME;
                        dtdocs.Rows.Add(dr);
                    }

                    SqlParameter sqlParamdoc = cmd.Parameters.AddWithValue("@TVPDOCS", dtdocs);
                    sqlParamdoc.SqlDbType = SqlDbType.Structured;

                    cmd.Parameters.Add("@RESULT", SqlDbType.Int);
                    cmd.Parameters["@RESULT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@CNT", SqlDbType.Int);
                    cmd.Parameters["@CNT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@MSG", SqlDbType.NVarChar, 500);
                    cmd.Parameters["@MSG"].Direction = ParameterDirection.Output;
                    con.Open();
                    cmd.ExecuteNonQuery();
                    objreturn.RESULT = Convert.ToInt32(cmd.Parameters["@RESULT"].Value);
                    objreturn.CNT    = Convert.ToInt32(cmd.Parameters["@CNT"].Value);
                    objreturn.MSG    = Convert.ToString(cmd.Parameters["@MSG"].Value);
                    con.Close();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(objreturn);
        }
Ejemplo n.º 18
0
        public DbStatusEntity InsertBS(BSParamEntity obj)
        {
            DbStatusEntity objreturn = new DbStatusEntity();
            string         CS        = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;

            try
            {
                using (SqlConnection con = new SqlConnection(CS))
                {
                    SqlCommand cmd = new SqlCommand("USP_InsertBillSettlement", con);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@C_ID", obj.C_ID);
                    cmd.Parameters.AddWithValue("@C_NO", obj.C_NO);
                    cmd.Parameters.AddWithValue("@FILE_NO", obj.FILE_NO);
                    cmd.Parameters.AddWithValue("@C_NAME", obj.C_NAME);
                    cmd.Parameters.AddWithValue("@BS_DATE", obj.BS_DATE);
                    cmd.Parameters.AddWithValue("@PAYMODE_ID", obj.PAYMODE_ID);
                    cmd.Parameters.AddWithValue("@PAYMODE_NAME", obj.PAYMODE_NAME);
                    cmd.Parameters.AddWithValue("@BS_AMT", obj.BS_AMT);
                    cmd.Parameters.AddWithValue("@REMARKS", obj.REMARKS);

                    DataTable dtsub = new DataTable();
                    dtsub.Columns.Add("SL_NO", typeof(int));
                    dtsub.Columns.Add("BILL_ID", typeof(int));
                    dtsub.Columns.Add("BILL_NO", typeof(int));
                    dtsub.Columns.Add("BILL_DATE", typeof(string));
                    dtsub.Columns.Add("BILL_AMT", typeof(Double));
                    dtsub.Columns.Add("PAID_AMT", typeof(Double));
                    dtsub.Columns.Add("BAL_AMT", typeof(Double));
                    dtsub.Columns.Add("BS_AMT", typeof(Double));

                    foreach (BSsubEntity objsub in obj.SUBARRAY)
                    {
                        if (objsub.BS_AMT > 0)
                        {
                            DataRow dr = dtsub.NewRow();
                            dr["SL_NO"]     = objsub.SL_NO;
                            dr["BILL_ID"]   = objsub.BILL_ID;
                            dr["BILL_NO"]   = objsub.BILL_NO;
                            dr["BILL_DATE"] = objsub.BILL_DATE;
                            dr["BILL_AMT"]  = objsub.BILL_AMT;
                            dr["PAID_AMT"]  = objsub.PAID_AMT;
                            dr["BAL_AMT"]   = objsub.BAL_AMT;
                            dr["BS_AMT"]    = objsub.BS_AMT;
                            dtsub.Rows.Add(dr);
                        }
                    }

                    SqlParameter sqlParam = cmd.Parameters.AddWithValue("@TVP", dtsub);
                    sqlParam.SqlDbType = SqlDbType.Structured;

                    cmd.Parameters.Add("@RESULT", SqlDbType.Int);
                    cmd.Parameters["@RESULT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@CNT", SqlDbType.Int);
                    cmd.Parameters["@CNT"].Direction = ParameterDirection.Output;
                    cmd.Parameters.Add("@MSG", SqlDbType.NVarChar, 500);
                    cmd.Parameters["@MSG"].Direction = ParameterDirection.Output;
                    con.Open();
                    cmd.ExecuteNonQuery();
                    objreturn.RESULT = Convert.ToInt32(cmd.Parameters["@RESULT"].Value);
                    objreturn.CNT    = Convert.ToInt32(cmd.Parameters["@CNT"].Value);
                    objreturn.MSG    = Convert.ToString(cmd.Parameters["@MSG"].Value);
                    con.Close();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(objreturn);
        }