Exemplo n.º 1
0
        private void Init_Form()
        {
            IMasterList objStoreList = (IMasterList)ObjectFactory.CreateInstance("BusinessProcess.SCM.BMasterList,BusinessProcess.SCM");

            dsStoreList = objStoreList.GetStoreUserLink(0);
            BindStoreDropdown();
        }
        /// <summary>
        /// Handles the Click event of the btnSave control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                List <int> UserList = new List <int>();
                int        storeId  = Convert.ToInt32(ddlStore.SelectedValue);
                for (int i = 0; i < chkItemList.Items.Count; i++)
                {
                    if (chkItemList.GetItemChecked(i) == true)
                    {
                        UserList.Add(Convert.ToInt32((((System.Data.DataRowView)(chkItemList.Items[i])).Row.ItemArray[0]).ToString()));
                    }
                }

                //string ItemType = ddlItemType.SelectedValue.ToString();
                IMasterList objMasterlist = (IMasterList)ObjectFactory.CreateInstance("BusinessProcess.SCM.BMasterList,BusinessProcess.SCM");
                int         ret           = objMasterlist.SaveUpdateStoreUserLinking(storeId, UserList);
                dsStoreList = objMasterlist.GetStoreUserLink(storeId);
                BindItemList();
                //  BindStoreDropdown();
                if (ret > 0)
                {
                    IQCareWindowMsgBox.ShowWindow("ProgramSave", this);
                    return;
                }
            }
            catch (Exception err)
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["MessageText"] = err.Message.ToString();
                IQCareWindowMsgBox.ShowWindowConfirm("#C1", theBuilder, this);
            }
        }
 /// <summary>
 /// Handles the SelectedIndexChanged event of the ddlStore control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
 private void ddlStore_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ddlStore.SelectedIndex != 0 && Convert.ToInt32(ddlStore.SelectedValue.ToString()) > 0)
     {
         IMasterList objStoreList = (IMasterList)ObjectFactory.CreateInstance("BusinessProcess.SCM.BMasterList,BusinessProcess.SCM");
         dsStoreList = objStoreList.GetStoreUserLink(Convert.ToInt32(ddlStore.SelectedValue.ToString()));
         BindItemList();
     }
     else
     {
         chkItemList.DataSource = null;
     }
 }
Exemplo n.º 4
0
 private void ddlStore_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ddlStore.SelectedIndex != 0 && Convert.ToInt32(ddlStore.SelectedValue.ToString()) > 0)
     {
         IMasterList objStoreList = (IMasterList)ObjectFactory.CreateInstance("BusinessProcess.SCM.BMasterList,BusinessProcess.SCM");
         dsStoreList = objStoreList.GetStoreUserLink(Convert.ToInt32(ddlStore.SelectedValue.ToString()));
         BindItemList();
     }
     else
     {
         BindFunctions theBind = new BindFunctions();
         chkItemList.DataSource = null;
         theBind.Win_BindCheckListBox(chkItemList, dsStoreList.Tables[1], "UserName", "UserID");
     }
 }