Esempio n. 1
0
        //Update
        public static bool UpdatePublisherType(ATTPublisher objPT, Previlege pobj)
        {
            string        UpdateSQL = "SP_EDIT_PUBLISHER";
            GetConnection GetConn   = new GetConnection();

            try
            {
                OracleConnection DBConn = GetConn.GetDbConn(Module.LIS);

                if (Previlege.HasPrevilege(pobj, DBConn) == false)
                {
                    throw new ArgumentException(Utilities.PreviledgeMsg + " update Publisher.");
                }

                OracleParameter[] paramArray = new OracleParameter[3];
                paramArray[0] = Utilities.GetOraParam("p_PUBLISHER_ID", objPT.PublisherID, OracleDbType.Int16, ParameterDirection.Input);
                paramArray[1] = Utilities.GetOraParam("p_PUBLISHER_NAME", objPT.PublisherName, OracleDbType.Varchar2, ParameterDirection.Input);
                paramArray[2] = Utilities.GetOraParam("p_PUBLISHER_ADDRESS", objPT.PublisherAddress, OracleDbType.Varchar2, ParameterDirection.Input);
                SqlHelper.ExecuteNonQuery(DBConn, CommandType.StoredProcedure, UpdateSQL, paramArray);
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                GetConn.CloseDbConn();
            }
        }
Esempio n. 2
0
 public static bool SavePublisher(ATTPublisher obj, Previlege pobj)
 {
     try
     {
         return(PCS.LIS.DLL.DLLPublisher.AddPublisher(obj, pobj));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 3
0
 public static bool UpdatePublisherType(ATTPublisher objPT, Previlege pobj)
 {
     try
     {
         DLLPublisher.UpdatePublisherType(objPT, pobj);
         return(true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 4
0
        //Delete publisher
        public static bool DeletePublisher(ATTPublisher objPT)
        {
            try
            {
                //if(Previlege.HasPrevilege(

                DLLPublisher.DeletePublisher(objPT);
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 5
0
        public static List <ATTPublisher> GetPublisherList()
        {
            List <ATTPublisher> PublisherTypeLST = new List <ATTPublisher>();

            foreach (DataRow row in  DLLPublisher.GetPublisher().Rows)
            {
                ATTPublisher PL = new ATTPublisher(int.Parse(row["PUBLISHER_ID"].ToString()),
                                                   row["PUBLISHER_NAME"].ToString(),
                                                   row["PUBLISHER_ADDRESS"].ToString()
                                                   );
                PublisherTypeLST.Add(PL);
            }
            return(PublisherTypeLST);
        }
Esempio n. 6
0
    protected void LBPublisher_SelectedIndexChanged(object sender, EventArgs e)
    {
        BtnDelete.Enabled = true;
        this.btnSave.Text = "Update";
        List <ATTPublisher> lst = (List <ATTPublisher>)Session["PublisherTypeList"];
        ATTPublisher PublisherType = lst.Find(delegate(ATTPublisher PT)
        {
            return(PT.PublisherID == int.Parse(this.LBPublisher.SelectedValue));
        }
                                              );

        this.txtPublisherName_Rqd.Text = PublisherType.PublisherName;
        this.txtLookupAddress_Rqd.Text = PublisherType.PublisherAddress;
        this.LblStatus.Text            = "";
    }
Esempio n. 7
0
    protected void BtnDelete_Click(object sender, EventArgs e)
    {
        ATTPublisher ObjPT;

        if (LBPublisher.SelectedIndex > -1)
        {
            ObjPT = new ATTPublisher(int.Parse(LBPublisher.SelectedValue));
            BLLPublisher.DeletePublisher(ObjPT);
            LBPublisher.Items.Remove(LBPublisher.SelectedItem);
            btnSave.Text = "Save";
            this.txtPublisherName_Rqd.Text = "";
            this.txtLookupAddress_Rqd.Text = "";
            this.txtPublisherName_Rqd.Focus();
            LblStatus.Text = "Deleted..";
        }
    }
Esempio n. 8
0
        //Deleting publisher record
        public static bool DeletePublisher(ATTPublisher objPT)
        {
            string        DeleteSQL = "SP_DEL_PUBLISHER";
            GetConnection GetConn   = new GetConnection();

            try
            {
                OracleConnection  DBConn     = GetConn.GetDbConn(Module.LIS);
                OracleParameter[] paramArray = new OracleParameter[1];
                paramArray[0] = Utilities.GetOraParam("p_PUBLISHER_ID", objPT.PublisherID, OracleDbType.Int16, ParameterDirection.Input);
                SqlHelper.ExecuteNonQuery(DBConn, CommandType.StoredProcedure, DeleteSQL, paramArray);
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                GetConn.CloseDbConn();
            }
        }
Esempio n. 9
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        ATTPublisher ObjPT;

        if (LBPublisher.SelectedIndex == -1)
        {
            ObjPT = new   ATTPublisher(0, txtPublisherName_Rqd.Text, txtLookupAddress_Rqd.Text, "User_Ashok", DateTime.Now.ToString());
        }
        else
        {
            ObjPT = new ATTPublisher(int.Parse(this.LBPublisher.SelectedValue), txtPublisherName_Rqd.Text, txtLookupAddress_Rqd.Text, "User_Ashok", DateTime.Now.ToString());
        }
        List <ATTPublisher> ltPublisher = (List <ATTPublisher>)Session["PublisherTypeList"];
        ATTUserLogin        user        = ((ATTUserLogin)Session["Login_User_Detail"]);

        try
        {
            if (LBPublisher.SelectedIndex == -1)
            {
                if (user.MenuList["4,8,1"] == null || user.MenuList["4,8,1"].PAdd == "N")
                {
                    this.LblStatus.Text = Utilities.PreviledgeMsg + " add Publisher.";
                    return;
                }
                Previlege pobj = new Previlege(user.UserName, "4,8,1", int.Parse(((HiddenField)this.Master.FindControl("hdnApplicationID")).Value), Previlege.PrevilegeType.P_ADD);

                if (BLLPublisher.SavePublisher(ObjPT, pobj))
                {
                    ltPublisher.Add(ObjPT);
                    LblStatus.Text            = "Publisher Inserted as: " + txtPublisherName_Rqd.Text + ".";
                    txtPublisherName_Rqd.Text = "";
                    txtLookupAddress_Rqd.Text = "";
                    btnSave.Text = "Save";
                    txtPublisherName_Rqd.Focus();
                }
            }
            else
            {
                if (user.MenuList["4,8,1"] == null || user.MenuList["4,8,1"].PEdit == "N")
                {
                    this.LblStatus.Text = Utilities.PreviledgeMsg + " add Publisher.";
                    return;
                }
                Previlege pobj = new Previlege(user.UserName, "4,8,1", int.Parse(((HiddenField)this.Master.FindControl("hdnApplicationID")).Value), Previlege.PrevilegeType.P_ADD);

                if (BLLPublisher.UpdatePublisherType(ObjPT, pobj))
                {
                    ltPublisher[this.LBPublisher.SelectedIndex] = ObjPT;
                    LblStatus.Text            = "Publisher Record Updated...";
                    btnSave.Text              = "Save";
                    txtPublisherName_Rqd.Text = "";
                    txtLookupAddress_Rqd.Text = "";
                    txtPublisherName_Rqd.Focus();
                }
            }
            LBPublisher.DataSource     = ltPublisher;
            LBPublisher.DataTextField  = "PublisherName";
            LBPublisher.DataValueField = "PublisherID";
            LBPublisher.DataBind();
        }
        catch (Exception ex)
        {
            this.LblStatus.Text = ex.Message;
        }
    }