Exemplo n.º 1
0
        public bool AddMLanguageDictionary(MLanguageDictionary mlanguagedictionary)
        {
            SqlCommand cmd;

            cmd             = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddMLanguageDictionary";

            cmd.Parameters.AddWithValue("@PkSrNo", mlanguagedictionary.PkSrNo);

            cmd.Parameters.AddWithValue("@EnglishVal", mlanguagedictionary.EnglishVal);

            cmd.Parameters.AddWithValue("@MarathiVal", mlanguagedictionary.MarathiVal);

            cmd.Parameters.AddWithValue("@HindiVal", mlanguagedictionary.HindiVal);

            cmd.Parameters.AddWithValue("@KarnatakaVal", mlanguagedictionary.KarnatakaVal);

            cmd.Parameters.AddWithValue("@CompanyNo", mlanguagedictionary.CompanyNo);
            if (ObjTrans.ExecuteNonQuery(cmd, CommonFunctions.ConStr) == true)
            {
                return(true);
            }
            else
            {
                mlanguagedictionary.msg = ObjTrans.ErrorMessage;
                return(false);
            }
        }
Exemplo n.º 2
0
        public MLanguageDictionary ModifyMLanguageDictionaryByID(long ID)
        {
            SqlConnection Con = new SqlConnection(CommonFunctions.ConStr);
            string        sql;
            SqlCommand    cmd;

            sql            = "Select * from MLanguageDictionary where PkSrNo =" + ID;
            cmd            = new SqlCommand(sql, Con);
            cmd.Connection = Con;
            Con.Open();
            cmd.CommandType = CommandType.Text;
            SqlDataReader dr;

            dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            if (dr.HasRows)
            {
                MLanguageDictionary MM = new MLanguageDictionary();
                while (dr.Read())
                {
                    MM.PkSrNo = Convert.ToInt32(dr["PkSrNo"]);
                    if (!Convert.IsDBNull(dr["EnglishVal"]))
                    {
                        MM.EnglishVal = Convert.ToString(dr["EnglishVal"]);
                    }
                    if (!Convert.IsDBNull(dr["MarathiVal"]))
                    {
                        MM.MarathiVal = Convert.ToString(dr["MarathiVal"]);
                    }
                    if (!Convert.IsDBNull(dr["HindiVal"]))
                    {
                        MM.HindiVal = Convert.ToString(dr["HindiVal"]);
                    }
                    if (!Convert.IsDBNull(dr["CompanyNo"]))
                    {
                        MM.CompanyNo = Convert.ToInt64(dr["CompanyNo"]);
                    }
                }
                dr.Close();
                return(MM);
            }
            else
            {
                dr.Close();
            }
            return(new MLanguageDictionary());
        }
Exemplo n.º 3
0
        public bool DeleteMLanguageDictionary(MLanguageDictionary mlanguagedictionary)
        {
            SqlCommand cmd;

            cmd             = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "DeleteMLanguageDictionary";

            cmd.Parameters.AddWithValue("@PkSrNo", mlanguagedictionary.PkSrNo);
            if (ObjTrans.ExecuteNonQuery(cmd, CommonFunctions.ConStr) == true)
            {
                return(true);
            }
            else
            {
                mlanguagedictionary.msg = ObjTrans.ErrorMessage;
                return(false);
            }
        }